Skip to content

Commit

Permalink
🔩 2.2.0 Release > Merge pull request #5 from CarterGames/prerelease
Browse files Browse the repository at this point in the history
📦 2.2.0 Release
  • Loading branch information
JonathanMCarter authored Sep 27, 2024
2 parents a27cdb7 + d010eb4 commit 979ea88
Show file tree
Hide file tree
Showing 63 changed files with 1,331 additions and 265 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 2.2.0
## Asset changes

- Added support for git URL importing of the asset over .unityPackage. This is considered the recommended install method going forward for ease of updates etc.
- Added porting tool to transfer user asset settings to the new location required for the git URL update.
- Updated scriptable asset flow with the latest from the cart library which is more modular and easy to use on the backend.
- Some additional helper classes for more performant editor operations from within the asset.
3 changes: 3 additions & 0 deletions CHANGELOG.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "CarterGames.Assets.SaveManager.Editor",
"name": "CarterGames.SaveManager.Editor",
"rootNamespace": "CarterGames.Assets.SaveManager.Editor",
"references": [
"GUID:5fed357a0eb29414bb1d1667107777c5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void DrawAllReferencesSection()
EditorGUI.indentLevel++;

EditorGUI.BeginDisabledGroup(Application.isPlaying);
EditorGUILayout.PropertyField(serializedObject.Fp("assets"));
EditorGUILayout.PropertyField(serializedObject.Fp("assets").Fpr("list"));
EditorGUI.EndDisabledGroup();

EditorGUI.indentLevel--;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private static void LoadSaveProfile(TextAsset data)
// Null Data
if (data == null)
{
SmLog.Normal("No data found in the profile, so nothing was loaded.");
SaveManagerLogger.Log("No data found in the profile, so nothing was loaded.");
return;
}

Expand All @@ -214,7 +214,7 @@ private static void LoadSaveProfile(TextAsset data)
}
catch (Exception e)
{
SmLog.Error($"Failed to read to {UtilEditor.AssetGlobalRuntimeSettings.SavePath} with the exception: {e}");
SaveManagerLogger.LogError($"Failed to read to {UtilEditor.AssetGlobalRuntimeSettings.SavePath} with the exception: {e}");
return;
}

Expand Down
3 changes: 3 additions & 0 deletions Carter Games/Save Manager/Code/Editor/Info.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static class AssetVersionData
/// <summary>
/// The version number of the asset.
/// </summary>
public static string VersionNumber => "2.1.8";
public static string VersionNumber => "2.2.0";


/// <summary>
Expand All @@ -40,6 +40,6 @@ public static class AssetVersionData
/// <remarks>
/// Asset owner is in the UK, so its D/M/Y format.
/// </remarks>
public static string ReleaseDate => "20/05/2024";
public static string ReleaseDate => "2024/09/27";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private static SerializedObject SettingsAssetObject
[MenuItem("Tools/Carter Games/Save Manager/Edit Settings", priority = 0)]
public static void OpenSettings()
{
SettingsService.OpenProjectSettings("Project/Carter Games/Save Manager");
SettingsService.OpenProjectSettings("Carter Games/Assets/Save Manager");
}

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static void TryInitialize()
/// </summary>
private static async void InitializeEditorClasses()
{
var initClasses = InterfaceHelper.GetAllInterfacesInstancesOfType<IAssetEditorInitialize>();
var initClasses = AssemblyHelper.GetClassesOfType<IAssetEditorInitialize>().ToArray();

if (initClasses.Length > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* THE SOFTWARE.
*/

using System.Linq;
using System.Threading.Tasks;
using CarterGames.Common;
using UnityEditor;
Expand Down Expand Up @@ -69,7 +70,7 @@ private static void FireReloadCalls()
/// </summary>
private static async void CallListeners()
{
var reloadClasses = InterfaceHelper.GetAllInterfacesInstancesOfType<IAssetEditorReload>();
var reloadClasses = AssemblyHelper.GetClassesOfType<IAssetEditorReload>().ToArray();

if (reloadClasses.Length > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace CarterGames.Assets.SaveManager.Editor
{
[Serializable]
[CreateAssetMenu(fileName = "Save Profile Store", menuName = "Carter Games/Save Manager/Save Profile Store", order = 6)]
public sealed class SaveProfilesStore : ScriptableObject
public sealed class SaveProfilesStore : SaveManagerAsset
{
[SerializeField] private List<TextAsset> profiles;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright (c) 2024 Carter Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;

namespace CarterGames.Assets.SaveManager.Editor
{
/// <summary>
/// A class to help redirect the user to the right update location for the asset. In theory...
/// </summary>
public sealed class InstallMethodChecker : IAssetEditorInitialize
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

private static ListRequest PackageManifestRequest { get; set; }


private static bool HasChecked
{
get => SessionState.GetBool("VersionValidation_InstallMethod_Checked", false);
set => SessionState.SetBool("VersionValidation_InstallMethod_Checked", value);
}


public static bool IsPackageInstalled
{
get => SessionState.GetBool("VersionValidation_InstallMethod_IsPackageManager", false);
set => SessionState.SetBool("VersionValidation_InstallMethod_IsPackageManager", value);
}

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| IAssetEditorInitialize Implementation
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

public int InitializeOrder { get; }


public void OnEditorInitialized()
{
if (HasChecked) return;

PackageManifestRequest = Client.List();

EditorApplication.update -= OnPackageManagerGetResolved;
EditorApplication.update += OnPackageManagerGetResolved;
}

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

private static void OnPackageManagerGetResolved()
{
if (!PackageManifestRequest.IsCompleted) return;

EditorApplication.update -= OnPackageManagerGetResolved;

if (PackageManifestRequest.Status != StatusCode.Success) return;

HasChecked = true;

foreach (var result in PackageManifestRequest.Result)
{
if (result.packageId.Equals("games.carter.thecart")) continue;
IsPackageInstalled = true;
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
* Copyright (c) 2024 Carter Games
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
* Copyright (c) 2024 Carter Games
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
* Copyright (c) 2024 Carter Games
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Expand Down Expand Up @@ -90,14 +90,12 @@ public string ReleaseDate
/// <returns>If the entry is a match or not on all values (major/minor/patch).</returns>
public bool Match(string toCompare)
{
var current = VersionNumber;
var remote = new VersionNumber(toCompare);
var aVN = VersionNumber;
var bVN = new VersionNumber(toCompare);

return current.Major.Equals(remote.Major) &&
current.Minor.Equals(remote.Minor) &&
current.Patch.Equals(remote.Patch);
return aVN.Major.Equals(bVN.Major) && aVN.Minor.Equals(bVN.Minor) && aVN.Patch.Equals(bVN.Patch);
}


/// <summary>
/// Gets if the entry is a higher version than the converted version.
Expand All @@ -106,20 +104,15 @@ public bool Match(string toCompare)
/// <returns>If the entry is greater on any (major/minor/patch) value.</returns>
public bool IsHigherVersion(string toCompare)
{
var current = VersionNumber;
var remote = new VersionNumber(toCompare);
var aVN = VersionNumber;
var bVN = new VersionNumber(toCompare);

if (Match(toCompare))
{
return false;
}

if (current.Major < remote.Major) return true;
if (current.Major.Equals(remote.Major) && current.Minor < remote.Minor) return true;

return current.Major.Equals(remote.Major) &&
current.Minor.Equals(remote.Minor) &&
current.Patch < remote.Patch;
return (aVN.Major < bVN.Major) || (aVN.Minor < bVN.Minor) || (aVN.Patch < bVN.Patch);
}
}
}
Loading

0 comments on commit 979ea88

Please sign in to comment.