- Home /
cannot change variables on scriptableobject asset in editor
I used to be able to edit the public variables in the editor on some .asset files, but after renaming them the values now jump back again when I try to change them.
When I create new scriptable object assets of the same type I have no problem changing the values, also after renaming the new assets, so it's just 5 files which are stuck for some reason. I could of course replace the assets with new ones but it would of course be preferable if I didn't have to type in all the variables again (it's used for storing stats sheets, so there is a lot variables).
Has anyone else experienced this, and is there a workaround?
Answer by Masterio · Feb 16, 2016 at 05:39 PM
Read about SetDirty() method.
Do you mean EditorUtility.SetDirty? The description says: "This function is due to be deprecated in future versions of Unity" So I would think there should be another way to do it. I found out i was missing serializedObject.Update(), and serializedObject.Apply$$anonymous$$odifiedProperties(). But the error still happens.
I have found out that it happens when I change the editor script on my custom editor. All the assets which was created before the editor was changed become unchangable. The data of the assets is still visible and I can also use it, but just not change it anymore.