Skip to content

Commit

Permalink
🔩 Merge pull request #8 from CarterGames/prerelease
Browse files Browse the repository at this point in the history
📦 2.3.2 Update
  • Loading branch information
JonathanMCarter authored Feb 2, 2025
2 parents de9a3e1 + 791d9de commit 48770e5
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ private static void ShowWindow()
private void OnEnable()
{
isInitialized = false;
SaveManagerEditorCache.RefreshCache();
}


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


/// <summary>
/// The date this release of the asset was submitted for release.
/// </summary>
/// <remarks>
/// Asset owner is in the UK, so its D/M/Y format.
/// Asset owner is in the UK, so its Y/M/D format.
/// </remarks>
public static string ReleaseDate => "2025/01/27";
public static string ReleaseDate => "2025/02/02";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ private static void TryRefreshCacheOnDelete(string[] deletedAssets)

foreach (var deleted in deletedAssets)
{
if (SaveManagerEditorCache.SaveObjectAssetPaths == null) goto SkipPoint;
if (!SaveManagerEditorCache.SaveObjectAssetPaths.Contains(deleted)) continue;
SaveManagerEditorCache.RefreshCache();
}

UtilEditor.SaveData.Data = SaveManagerEditorCache.SaveObjects.Where(t => t != null).ToList();
EditorUtility.SetDirty(UtilEditor.SaveData);

SkipPoint: ;

AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace CarterGames.Assets.SaveManager.Editor
{
public class SaveManagerEditorCache : IAssetEditorInitialize
{
private static List<SaveObject> saveObjects;
private static List<string> saveObjectPaths;
private static List<SaveObject> saveObjects = new List<SaveObject>();
private static List<string> saveObjectPaths = new List<string>();

private static Dictionary<SaveObject, SaveObjectEditor> editorsLookup;
private static Dictionary<SaveObject, SerializedObject> soLookup;
private static Dictionary<SaveObject, SaveObjectEditor> editorsLookup = new Dictionary<SaveObject, SaveObjectEditor>();
private static Dictionary<SaveObject, SerializedObject> soLookup = new Dictionary<SaveObject, SerializedObject>();


public static bool HasCache { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@ public void ResetElement(string key)
if (!Lookup.ContainsKey(key)) return;
Lookup[key].ResetValue();
}


private void OnDestroy()
{
Debug.Log("Destroyed!");
}

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Save Object Attributes
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
Expand Down
12 changes: 6 additions & 6 deletions Carter Games/Save Manager/Demo/Data/Example Save Object.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 11010672a3811f84e8d31964f42df820, type: 3}
m_Name: Example Save Object
m_EditorClassIdentifier:
isExpanded: 1
isExpanded: 0
saveKey: Example
playerName:
key: examplePlayerName
value: Annie
value: Emily
defaultValue: Emily
playerHealth:
key: examplePlayerHealth
value: 100
defaultValue: 0
value: 50
defaultValue: 50
playerPosition:
key: examplePlayerPosition
value: {x: 1, y: 2, z: 3}
value: {x: 0, y: 0, z: 0}
defaultValue: {x: 0, y: 0, z: 0}
playerShield:
key: examplePlayerShield
value: 4
value: 0
defaultValue: 0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "games.carter.savemanager",
"version": "2.3.1",
"version": "2.3.2",
"displayName": "Save Manager",
"description": "A free, scriptable object based, local save system for Unity. Works on all platforms using standard JSON Utility.",
"unity": "2020.3",
Expand Down

0 comments on commit 48770e5

Please sign in to comment.