public static AssetType GetAsset(TKey key, string path) { BaseScriptableObjectDatabase <TKey, TValue, AssetType> db = GetDatabase(path); UnityEngine.Assertions.Assert.IsNotNull(db, "Database with path " + path + "has not been loaded."); return(db.InternalGetAsset(key)); }
protected static BaseScriptableObjectDatabase <TKey, TValue, AssetType> GetDatabase(string resourcePath) { if (s_assetDatabase == null) { s_assetDatabase = (BaseScriptableObjectDatabase <TKey, TValue, AssetType>)Resources.Load(resourcePath); } return(s_assetDatabase); }
public static void DeleteEntry(TKey key, TValue value, string path) { BaseScriptableObjectDatabase <TKey, TValue, AssetType> db = GetDatabaseEditorMode(path); db.InternalDeleteEntry(key, value); UnityEditor.EditorUtility.SetDirty(db); UnityEditor.AssetDatabase.SaveAssets(); }
public static void ClearDatabase(string path) { BaseScriptableObjectDatabase <TKey, TValue, AssetType> db = GetDatabaseEditorMode(path); db.InternalClearDatabase(); UnityEditor.EditorUtility.SetDirty(db); UnityEditor.AssetDatabase.SaveAssets(); }
protected static BaseScriptableObjectDatabase <TKey, TValue, AssetType> GetDatabaseEditorMode(string path) { BaseScriptableObjectDatabase <TKey, TValue, AssetType> db = (BaseScriptableObjectDatabase <TKey, TValue, AssetType>)UnityEditor.AssetDatabase.LoadAssetAtPath(path, typeof(BaseScriptableObjectDatabase <TKey, TValue, AssetType>)); return(db); }