static void LoadDatabase() { if (CollectionDataEditorDebugging) { Debug.Log("CollectionDataEditor:: LoadDatabase():: Start."); } databaseCache = (CollectionDatabase)Resources.Load(databaseName, typeof(CollectionDatabase)); if (!databaseCache) { Directory.CreateDirectory(databaseDir); databaseCache = CollectionDatabase.Create(); AssetDatabase.CreateAsset(databaseCache, databaseDir + databaseName + ".asset"); SaveDatabase(); if (CollectionDataEditorDebugging) { Debug.Log("CollectionDataEditor:: LoadDatabase():: Created a new database asset because no database asset found at designated path."); } } if (CollectionDataEditorDebugging) { Debug.Log("CollectionDataEditor:: LoadDatabase():: Done."); } }
public static CollectionDatabase Create() { CollectionDatabase created = ScriptableObject.CreateInstance <CollectionDatabase>(); created.itemList = new List <CollectionDataEntry>(); return(created); }