-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Using v4.23.1.
The new AdjustSettings ScriptableObject is not written to disk after toggling anything on it.
Unity keeps the object in memory and the "Toggle ..." menu options change values (e.g. isiOS14ProcessingEnabled) on the memory instance but this is not actually saved until you save the current scene or project.
Even worse the "Check ..." menu options will report the unsaved value from memory.
This is at least confusing (because source control will not pick the change up until saved) or even dangerous (Unity crashes: the change will be lost).
You should not keep an Instance of the object in memory at all, imho. Load it the moment you want to read or change a value. Then save it if there were changes and unload the object.
So:
var instance = (AdjustSettings)AssetDatabase.LoadAssetAtPath("Assets/Adjust/Editor/AdjustSettings.asset", typeof(AdjustSettings));
// ... read or write value here
// if a value was changed:
EditorUtility.SetDirty(instance);
AssetDatabase.SaveAssets();
For now the workaround is to manually save the project (or scene) after changing the value.