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
- [Android] The Player freezes when disabling Bluetooth while connected to the headphones
- Addressable bundles are not retrieved from the cache when a WebGL Player is refreshed
- Sprites are incorrectly occluded by Sprite Physics Shape culling when behind in sorting order
- CPU usage is increased when the Editor is idle with the ProBuilder Package installed
- Unstable lighting when additional light sources are added in Shader Graph nodes
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.