Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.2.16f1
Issue ID
1103759
Regression
No
Serialization layout error thrown in Build when using Generic Classes with fields that only exist in the editor
How to reproduce:
1. Open the user-submitted Project ("Bug - Serialization layout.zip")
2. Build and run the Player with the "development build" option enabled
3. Observe the console error
Expected result: no error is thrown in the build because the #if UNITY_EDITOR directive is used
Actual result: "A script behaviour (probably Test?) has a different serialization layout when loading. (Read 36 bytes but expected 40 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?" error is thrown in the build version
Reproduced in: 2019.1.0a11, 2018.3.0f1, 2018.2.19f1, 2018.1.9f2, 2017.4.17f1
Note: When using a regularClassInstance with the same code the error does not occur
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:
We will not add support for this use and it therefore won't be fixed.