Search Issue Tracker
By Design
Votes
1
Found in
5.4.0b13
Issue ID
788816
Regression
No
Custom Editor does not serialize UnityEvent parameters when using SerializedObject
Steps to reproduce:
1. Open attached project
2. Open scene "Scene"
3. Select the "Events" object in the hierarchy
4. Add a new event or just click the "+" to add an action to an existing one
5. Add some object (for example the Main Camera)
6. Select a function (for example GameObject.SetActive)
7. Change the default parameter to something else (in the above case, check the checkbox)
8. Select another object from the hierarchy (for example Main Camera)
9. Then select the "Events" object again
10. The checkbox has been reverted to it's default state
Reproduced with: 5.2.4f1, 5.3.4f1, 5.4.0b15
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
Resolution Note:
The problem is that the user is creating a new SerializedObject representation for each of the ScriptableObjects in every phase of the IMGUI loop in the MyComponent editor. For example, if the user adds [CreateAssetMenu] attribute to the MyScriptableObject class and simply creates one in the project, the problem does not appear to exist for that individual asset. Instead, the user should cache the SerializedObject values for each of the ScriptableObjects, and the problem seems to go away.