void LoadSettings() { string editorPath = System.IO.Path.GetDirectoryName(AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this))); settings = AssetDatabase.LoadAssetAtPath(editorPath + "/settings.asset", typeof(ChronoEggSettings)) as ChronoEggSettings; if (settings == null) { settings = ScriptableObject.CreateInstance <ChronoEggSettings>(); AssetDatabase.CreateAsset(settings, editorPath + "/settings.asset"); AssetDatabase.SaveAssets(); //Debug.Log("Settings created at path " + editorPath + "/settings.asset"); } }
void LoadSettings() { string editorPath = System.IO.Path.GetDirectoryName(AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this))); settings = AssetDatabase.LoadAssetAtPath(editorPath + "/settings.asset", typeof(ChronoEggSettings)) as ChronoEggSettings; if (settings == null) { settings = ScriptableObject.CreateInstance <ChronoEggSettings>(); AssetDatabase.CreateAsset(settings, editorPath + "/settings.asset"); AssetDatabase.SaveAssets(); } myDate = settings.targetDate; timerColor = settings.textColor; backgroundColor = settings.backgroundColor; }