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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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.