Hi we’re updating our code and migrating to using asmdefs instead of compiling our own dlls. It looks like we’ve got an issue with our builds having a black screen crash with the following issue:
A scripted object (probably TMPro.TMP_FontAsset?) has a different serialization layout when loading. (Read 2128 bytes but expected 10960 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
Sure enough I look inside the TMP_FontAsset and that is exactly what I saw:
#if UNITY_EDITOR
/// <summary>
/// Persistent reference to the source font file maintained in the editor.
/// </summary>
[SerializeField]
internal Font m_SourceFontFile_EditorRef;
#endif
What’s weird about this is that we were not seeing this when we were compiling our dlls and linking to TMP. Perhaps we were linking against, and compiling, an editor-version of TMP into our build?
This issue goes away if I reimport just TMPro or do a Reimport All. So it sounds like there may be some kind of bug with the compilation system or with Package Manager.
It also goes away if I remove the #if in the package source.
I currently don’t have a project I can give you for a bug repro. I have a general idea of how to create one but I can’t give you our current project. But this does seem like a bug, one that I’m also confused others are not encountering.