/// <summary> /// Creation of new database /// </summary> void CreateDatabase() { if (Application.isPlaying) { return; } F3DTurretScriptable newManager = ScriptableObject.CreateInstance <F3DTurretScriptable>(); newManager.Turrets = turrets; AssetDatabase.CreateAsset(newManager, "Assets/FORGE3D/Sci-Fi Effects/Turrets/Database/database.asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }
/// <summary> /// Loading database from resources /// </summary> void LoadDatabase() { F3DTurretScriptable newManager = AssetDatabase.LoadAssetAtPath("Assets/FORGE3D/Sci-Fi Effects/Turrets/Database/database.asset", typeof(ScriptableObject)) as F3DTurretScriptable; if (newManager != null) { db = newManager; InstallAll(); } else { CreateDatabase(); } }