Skip to content

Commit

Permalink
📦 2.0.10 Release
Browse files Browse the repository at this point in the history
- Fixed an assembly issue with the common code shared between assets.
- Temp fix for a compatibility issue due to script overriding, though still not sure why it even happens on just 2 scripts xD
  • Loading branch information
JonathanMCarter committed Aug 3, 2023
1 parent 6b57de7 commit 8c4fbab
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 57 deletions.
4 changes: 2 additions & 2 deletions Code/Editor/Utility/AssetVersionData.cs
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.0.9";
public static string VersionNumber => "2.0.10";


/// <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 => "30/07/2023";
public static string ReleaseDate => "03/08/2023";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace CarterGames.Assets.SaveManager.Editor
/// <summary>
/// Handles finding assets in the project in editor space and creating/referencing/caching them for use.
/// </summary>
public static class FileEditorUtil
public static class FileEditorUtilSM
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2018-Present Carter Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -29,7 +29,7 @@ namespace CarterGames.Assets.SaveManager.Editor
/// <summary>
/// Handles references to scriptable objects in the asset that need generating without user input etc.
/// </summary>
public static class ScriptableRef
public static class ScriptableRefSM
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
Expand All @@ -47,22 +47,22 @@ public static class ScriptableRef

// Asset Filters
/* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
private static readonly string RuntimeSettingsFilter = $"t:{typeof(SettingsAssetRuntime).FullName}";
private static readonly string EditorSettingsFilter = $"t:{typeof(SettingsAssetEditor).FullName}";
private static readonly string AssetIndexFilter = $"t:{typeof(AssetIndex).FullName}";
private static readonly string SaveProfilesStoreFilter = $"t:{typeof(SaveProfilesStore).FullName}";
private static readonly string SaveDataFilter = $"t:{typeof(SaveData).FullName}";
private static readonly string SaveDataEncryptionKeyFilter = $"t:{typeof(EncryptionKeyAsset).FullName}";
private static readonly string RuntimeSettingsFilter = $"t:{typeof(CarterGames.Assets.SaveManager.SettingsAssetRuntime).FullName}";
private static readonly string EditorSettingsFilter = $"t:{typeof(CarterGames.Assets.SaveManager.Editor.SettingsAssetEditor).FullName}";
private static readonly string AssetIndexFilter = $"t:{typeof(CarterGames.Assets.SaveManager.AssetIndex).FullName}";
private static readonly string SaveProfilesStoreFilter = $"t:{typeof(CarterGames.Assets.SaveManager.Editor.SaveProfilesStore).FullName}";
private static readonly string SaveDataFilter = $"t:{typeof(CarterGames.Assets.SaveManager.SaveData).FullName}";
private static readonly string SaveDataEncryptionKeyFilter = $"t:{typeof(CarterGames.Assets.SaveManager.EncryptionKeyAsset).FullName}";


// Asset Caches
/* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
private static SettingsAssetRuntime settingsAssetRuntimeCache;
private static SettingsAssetEditor settingsAssetEditorCache;
private static AssetIndex assetIndexCache;
private static SaveProfilesStore saveProfilesStoreCache;
private static SaveData saveDataCache;
private static EncryptionKeyAsset encryptionKeyAssetCache;
private static CarterGames.Assets.SaveManager.SettingsAssetRuntime settingsAssetRuntimeCache;
private static CarterGames.Assets.SaveManager.Editor.SettingsAssetEditor settingsAssetEditorCache;
private static CarterGames.Assets.SaveManager.AssetIndex assetIndexCache;
private static CarterGames.Assets.SaveManager.Editor.SaveProfilesStore saveProfilesStoreCache;
private static CarterGames.Assets.SaveManager.SaveData saveDataCache;
private static CarterGames.Assets.SaveManager.EncryptionKeyAsset encryptionKeyAssetCache;


// SerializedObject Caches
Expand All @@ -80,13 +80,13 @@ public static class ScriptableRef
/// <summary>
/// Gets the path where the asset code is located.
/// </summary>
private static string AssetBasePath => FileEditorUtil.AssetBasePath;
private static string AssetBasePath => FileEditorUtilSM.AssetBasePath;


/// <summary>
/// Gets the asset name stored in the file util editor class.
/// </summary>
private static string AssetName => FileEditorUtil.AssetName;
private static string AssetName => FileEditorUtilSM.AssetName;


// Asset Properties
Expand All @@ -95,43 +95,43 @@ public static class ScriptableRef
/// <summary>
/// The asset index for the asset.
/// </summary>
public static AssetIndex AssetIndex =>
FileEditorUtil.CreateSoGetOrAssignAssetCache(ref assetIndexCache, AssetIndexFilter, AssetIndexPath, AssetName, $"{AssetName}/Resources/Asset Index.asset");
public static CarterGames.Assets.SaveManager.AssetIndex AssetIndex =>
FileEditorUtilSM.CreateSoGetOrAssignAssetCache(ref assetIndexCache, AssetIndexFilter, AssetIndexPath, AssetName, $"{AssetName}/Resources/Asset Index.asset");


/// <summary>
/// The editor settings for the asset.
/// </summary>
public static SettingsAssetEditor EditorSettings =>
FileEditorUtil.CreateSoGetOrAssignAssetCache(ref settingsAssetEditorCache, EditorSettingsFilter, EditorSettingsAssetPath, AssetName, $"{AssetName}/Data/Editor Settings.asset");
public static CarterGames.Assets.SaveManager.Editor.SettingsAssetEditor EditorSettings =>
FileEditorUtilSM.CreateSoGetOrAssignAssetCache(ref settingsAssetEditorCache, EditorSettingsFilter, EditorSettingsAssetPath, AssetName, $"{AssetName}/Data/Editor Settings.asset");


/// <summary>
/// The runtime settings for the asset.
/// </summary>
public static SettingsAssetRuntime RuntimeSettings =>
FileEditorUtil.CreateSoGetOrAssignAssetCache(ref settingsAssetRuntimeCache, RuntimeSettingsFilter, SettingsAssetPath, AssetName, $"{AssetName}/Data/Runtime Settings.asset");
public static CarterGames.Assets.SaveManager.SettingsAssetRuntime RuntimeSettings =>
FileEditorUtilSM.CreateSoGetOrAssignAssetCache(ref settingsAssetRuntimeCache, RuntimeSettingsFilter, SettingsAssetPath, AssetName, $"{AssetName}/Data/Runtime Settings.asset");


/// <summary>
/// The save profiles for the asset.
/// </summary>
public static SaveProfilesStore SaveProfiles =>
FileEditorUtil.CreateSoGetOrAssignAssetCache(ref saveProfilesStoreCache, SaveProfilesStoreFilter, CapturesObjectAssetPath, AssetName, $"{AssetName}/Data/Save Profiles Container.asset");
public static CarterGames.Assets.SaveManager.Editor.SaveProfilesStore SaveProfiles =>
FileEditorUtilSM.CreateSoGetOrAssignAssetCache(ref saveProfilesStoreCache, SaveProfilesStoreFilter, CapturesObjectAssetPath, AssetName, $"{AssetName}/Data/Save Profiles Container.asset");


/// <summary>
/// The save data for the asset.
/// </summary>
public static SaveData SaveData =>
FileEditorUtil.CreateSoGetOrAssignAssetCache(ref saveDataCache, SaveDataFilter, SaveDataPath, AssetName, $"{AssetName}/Data/Save Data.asset");
public static CarterGames.Assets.SaveManager.SaveData SaveData =>
FileEditorUtilSM.CreateSoGetOrAssignAssetCache(ref saveDataCache, SaveDataFilter, SaveDataPath, AssetName, $"{AssetName}/Data/Save Data.asset");


/// <summary>
/// The encryption key asset for the asset.
/// </summary>
public static EncryptionKeyAsset EncryptionKey =>
FileEditorUtil.CreateSoGetOrAssignAssetCache(ref encryptionKeyAssetCache, SaveDataEncryptionKeyFilter, EncryptionKeyAssetPath, AssetName, $"{AssetName}/Data/Encryption Key.asset");
public static CarterGames.Assets.SaveManager.EncryptionKeyAsset EncryptionKey =>
FileEditorUtilSM.CreateSoGetOrAssignAssetCache(ref encryptionKeyAssetCache, SaveDataEncryptionKeyFilter, EncryptionKeyAssetPath, AssetName, $"{AssetName}/Data/Encryption Key.asset");

// Object Properties
/* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
Expand All @@ -140,14 +140,14 @@ public static class ScriptableRef
/// The editor SerializedObject for the asset.
/// </summary>
public static SerializedObject EditorSettingsObject =>
FileEditorUtil.CreateGetOrAssignSerializedObjectCache(ref settingsAssetEditorObjectCache, EditorSettings);
FileEditorUtilSM.CreateGetOrAssignSerializedObjectCache(ref settingsAssetEditorObjectCache, EditorSettings);


/// <summary>
/// The runtime SerializedObject for the asset.
/// </summary>
public static SerializedObject RuntimeSettingsObject =>
FileEditorUtil.CreateGetOrAssignSerializedObjectCache(ref settingsAssetRuntimeObjectCache, RuntimeSettings);
FileEditorUtilSM.CreateGetOrAssignSerializedObjectCache(ref settingsAssetRuntimeObjectCache, RuntimeSettings);

// Assets Initialized Check
/* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
Expand Down
42 changes: 21 additions & 21 deletions Code/Editor/Utility/UtilEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static class UtilEditor
/// <summary>
/// Gets the path where the asset code is located.
/// </summary>
private static string AssetBasePath => FileEditorUtil.AssetBasePath;
private static string AssetBasePath => FileEditorUtilSM.AssetBasePath;


// Textures/Graphics
Expand All @@ -156,72 +156,72 @@ public static class UtilEditor
/// <summary>
/// Gets the save manager logo.
/// </summary>
public static Texture2D SaveManagerLogo => FileEditorUtil.GetOrAssignCache(ref saveManagerLogoCache, SaveManagerLogoFilter);
public static Texture2D SaveManagerLogo => FileEditorUtilSM.GetOrAssignCache(ref saveManagerLogoCache, SaveManagerLogoFilter);


/// <summary>
/// Gets the save manager banner.
/// </summary>
public static Texture2D SaveManagerBanner =>
FileEditorUtil.GetOrAssignCache(ref saveManagerBannerCache, SaveManagerBannerFilter);
FileEditorUtilSM.GetOrAssignCache(ref saveManagerBannerCache, SaveManagerBannerFilter);


/// <summary>
/// Gets the save manager banner.
/// </summary>
public static Texture2D SaveManagerBannerTextOnly =>
FileEditorUtil.GetOrAssignCache(ref saveManagerTitleBannerCache, SaveManagerTitleBannerFilter);
FileEditorUtilSM.GetOrAssignCache(ref saveManagerTitleBannerCache, SaveManagerTitleBannerFilter);


/// <summary>
/// Gets the carter games banner.
/// </summary>
public static Texture2D CarterGamesBanner =>
FileEditorUtil.GetOrAssignCache(ref carterGamesBannerCache, CarterGamesBannerFilter);
FileEditorUtilSM.GetOrAssignCache(ref carterGamesBannerCache, CarterGamesBannerFilter);


/// <summary>
/// Gets the cog icon.
/// </summary>
public static Texture2D CogIcon => FileEditorUtil.GetOrAssignCache(ref cogIconCache, CogIconFilter);
public static Texture2D CogIcon => FileEditorUtilSM.GetOrAssignCache(ref cogIconCache, CogIconFilter);


/// <summary>
/// Gets the key icon.
/// </summary>
public static Texture2D KeyIcon => FileEditorUtil.GetOrAssignCache(ref keyIconCache, KeyIconFilter);
public static Texture2D KeyIcon => FileEditorUtilSM.GetOrAssignCache(ref keyIconCache, KeyIconFilter);


/// <summary>
/// Gets the book icon.
/// </summary>
public static Texture2D BookIcon => FileEditorUtil.GetOrAssignCache(ref bookIconCache, BookIconFilter);
public static Texture2D BookIcon => FileEditorUtilSM.GetOrAssignCache(ref bookIconCache, BookIconFilter);


/// <summary>
/// Gets the data icon.
/// </summary>
public static Texture2D DataIcon => FileEditorUtil.GetOrAssignCache(ref dataIconCache, DataIconFilter);
public static Texture2D DataIcon => FileEditorUtilSM.GetOrAssignCache(ref dataIconCache, DataIconFilter);


/// <summary>
/// Gets the white save icon.
/// </summary>
public static Texture2D SaveIconWhite => FileEditorUtil.GetOrAssignCache(ref saveIconWhite, SaveWhiteIconFilter);
public static Texture2D SaveIconWhite => FileEditorUtilSM.GetOrAssignCache(ref saveIconWhite, SaveWhiteIconFilter);


/// <summary>
/// Gets the title text for the editor tab in the save manager editor window.
/// </summary>
public static Texture2D EditorWindowTitleEditor =>
FileEditorUtil.GetOrAssignCache(ref editorWindowTitleEditor, EditorWindowTitleEditorFilter);
FileEditorUtilSM.GetOrAssignCache(ref editorWindowTitleEditor, EditorWindowTitleEditorFilter);


/// <summary>
/// Gets the title text for the profiles tab in the save manager editor window.
/// </summary>
public static Texture2D EditorWindowTitleProfiles =>
FileEditorUtil.GetOrAssignCache(ref editorWindowTitleProfiles, EditorWindowTitleProfilesFilter);
FileEditorUtilSM.GetOrAssignCache(ref editorWindowTitleProfiles, EditorWindowTitleProfilesFilter);



Expand All @@ -236,58 +236,58 @@ public static bool HasInitialized
get
{
AssetIndexHandler.UpdateIndex();
return ScriptableRef.HasAllAssets;
return ScriptableRefSM.HasAllAssets;
}
}


/// <summary>
/// Gets/Sets the save manager settings asset.
/// </summary>
public static SettingsAssetRuntime Settings => ScriptableRef.RuntimeSettings;
public static CarterGames.Assets.SaveManager.SettingsAssetRuntime Settings => ScriptableRefSM.RuntimeSettings;


/// <summary>
/// Gets/Sets the save manager editor settings asset.
/// </summary>
public static SerializedObject SettingsObject => ScriptableRef.RuntimeSettingsObject;
public static SerializedObject SettingsObject => ScriptableRefSM.RuntimeSettingsObject;


/// <summary>
/// Gets/Sets the save manager editor settings asset.
/// </summary>
public static SettingsAssetEditor SettingsAssetEditor => ScriptableRef.EditorSettings;
public static CarterGames.Assets.SaveManager.Editor.SettingsAssetEditor SettingsAssetEditor => ScriptableRefSM.EditorSettings;


/// <summary>
/// Gets/Sets the save manager editor settings asset.
/// </summary>
public static SerializedObject EditorSettingsObject => ScriptableRef.EditorSettingsObject;
public static SerializedObject EditorSettingsObject => ScriptableRefSM.EditorSettingsObject;



/// <summary>
/// Gets/Sets the save manager save profiles asset.
/// </summary>
public static SaveProfilesStore SaveProfiles => ScriptableRef.SaveProfiles;
public static CarterGames.Assets.SaveManager.Editor.SaveProfilesStore SaveProfiles => ScriptableRefSM.SaveProfiles;


/// <summary>
/// Gets/Sets the save manager save data asset.
/// </summary>
public static SaveData SaveData => ScriptableRef.SaveData;
public static CarterGames.Assets.SaveManager.SaveData SaveData => ScriptableRefSM.SaveData;


/// <summary>
/// Gets/Sets the save manager save data asset.
/// </summary>
public static EncryptionKeyAsset EncryptionKeyAsset => ScriptableRef.EncryptionKey;
public static CarterGames.Assets.SaveManager.EncryptionKeyAsset EncryptionKeyAsset => ScriptableRefSM.EncryptionKey;


/// <summary>
/// Gets/Sets the save manager save data asset.
/// </summary>
public static AssetIndex AssetIndex => ScriptableRef.AssetIndex;
public static CarterGames.Assets.SaveManager.AssetIndex AssetIndex => ScriptableRefSM.AssetIndex;

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Draw Methods
Expand Down
3 changes: 0 additions & 3 deletions Code/Runtime/Common/CarterGames.Common.asmdef

This file was deleted.

14 changes: 14 additions & 0 deletions Code/Runtime/Common/CarterGames.SaveManager.Common.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "CarterGames.SaveManager.Common",
"rootNamespace": "",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

0 comments on commit 8c4fbab

Please sign in to comment.