public static void Initialize() { // NOTE: When the play button is pressed, all editor objects are unloaded so we need to reload things: https://blogs.unity3d.com/2012/10/25/unity-serialization/ if (sProjectSettings == null) { sProjectSettings = KnetikEditorScriptableObjectUtis.LoadPersistentData <KnetikCloudProjectSettings>(KnetikCloudProjectSettings.SaveDataPath); if (sProjectSettings == null) { sProjectSettings = ScriptableObject.CreateInstance <KnetikCloudProjectSettings>(); KnetikEditorAssetDatabaseUtils.CreateAssetAndDirectories(sProjectSettings, KnetikCloudProjectSettings.SaveDataPath); } } if (sCloudCredentials == null) { sCloudCredentials = KnetikEditorScriptableObjectUtis.LoadPersistentData <KnetikCloudCredentials>(KnetikCloudCredentials.SaveDataPath); if (sCloudCredentials == null) { sCloudCredentials = ScriptableObject.CreateInstance <KnetikCloudCredentials>(); KnetikEditorAssetDatabaseUtils.CreateAssetAndDirectories(sCloudCredentials, KnetikCloudCredentials.SaveDataPath); } } }
private void SaveSettings() { KnetikEditorScriptableObjectUtis.SavePersistentData(); KnetikUserCredentials.Save(mUserCredentials); }