Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: athos on November 30, 2012, 05:51:08 PM

Title: Serialization warning
Post by: athos on November 30, 2012, 05:51:08 PM
I get the following on startup:

A script behaviour has a different serialization layout when loading. (Read 24 bytes but expected 32 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

I believe I've tracked it down to UIPanel.cs:

#if UNITY_EDITOR
   // Screen size, saved for gizmos, since Screen.width and Screen.height returns the Scene view's dimensions in OnDrawGizmos.
   Vector2 mScreenSize = Vector2.one;
#endif

Is the #if necessary or can a NonSerialized attribute be added?
Title: Re: Serialization warning
Post by: Nicki on December 01, 2012, 07:28:23 AM
That doesn't make sense. The mScreenSize shouldn't be serialized from what I can see.
Title: Re: Serialization warning
Post by: ArenMook on December 01, 2012, 11:35:41 AM
Private fields don't get serialized, yeah. What version of NGUI / Unity?
Title: Re: Serialization warning
Post by: athos on December 01, 2012, 07:06:19 PM
Nicki, you're quite right. I just confirmed the issue was in fact coming from a different project file. Thanks for pointing that out.
Title: Re: Serialization warning
Post by: Anxo on January 14, 2015, 05:57:54 PM
Nicki, you're quite right. I just confirmed the issue was in fact coming from a different project file. Thanks for pointing that out.

Hi Sorry, I have no intention of highjacking NGUI fourm but this I now have this problem and can not find the solution. @athos What did you track this issue down to?
Title: Re: Serialization warning
Post by: ArenMook on January 14, 2015, 10:11:31 PM
You need to start a new thread and better explain your issue, Anxo. This thread is from 2012.