Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
1
Found in
2019.4
2019.4.1f1
2020.2
Issue ID
1260686
Regression
No
Editor only classes break serialization when using SerializeReference attribute
How to reproduce:
1. Open user's attached "SerializeReference Bug.zip" project
2. Open "Bug" Scene
3. Go to File -> Build And Run
4. Observe the player
Expected result: No error messages are thrown
Actual result: "A scripted object (probably Bug?) has a different serialization layout when loading" error message is thrown
Reproducible with: 2019.4.3f1, 2020.1.0b15, 2020.2.0a18
Could not test with: 2018.4.24f1 (SerializeReference attribute not supported)
Notes:
- The issue is not reproducible in the Unity Editor
- Removing #if UNITY_EDITOR from the class removes the issue
- The issue is reproducible on both Windows and Mac player
-
WilliamBenichou
Mar 18, 2021 11:48
Still present in 2019.4.12f1, removing #if UNITY_EDITOR on already corrupted ScriptableObjects doesn't seem to fix them...
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
- Shadows are not cast when the Light's CullingMask and the GameObject's Layer do not match
- Graphics.DrawMeshInstanced does not work when 2D Renderer and 2D Shaders are used
- SpeedTree does not move when using WindZone
- "Undeclared identifier 'LinearToSRGB'" error is thrown when creating a color variable with HDR color mode and assigning a Custom Render Texture target in Shader Graph
- Input System package is missing when creating a new HDRP project
Resolution Note (2020.2.X):
This will require some significant architectural changes which we are looking to address in the 2021 time frame.