Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: mathiassoeholm on March 12, 2014, 06:11:46 AM

Title: NGUI warnings
Post by: mathiassoeholm on March 12, 2014, 06:11:46 AM
Hello

I'm currently in the process of cleaning up the warnings in our Unity project.
I'm getting three warnings from NGUI, I'm on version 3.5.1.

Field 'UIToggle.radioButtonRoot' is never assigned to, and will always have its default value null   UIToggle.cs 76
Field 'UISlider.foreground' is never assigned to, and will always have its default value null   UISlider.cs   25
Field 'SpringPosition.eventReceiver' is never assigned to, and will always have its default value null SpringPosition.cs 57
Title: Re: NGUI warnings
Post by: ArenMook on March 12, 2014, 06:05:27 PM
Those are serialized fields, set by Unity. What version of Unity are you seeing that in?
Title: Re: NGUI warnings
Post by: mathiassoeholm on March 14, 2014, 03:46:55 AM
I'm on version 4.3.4f1.

Actually the warnings only show up in the IDE and not in the Unity console, so it's just Visual Studio whining.
Title: Re: NGUI warnings
Post by: Nicki on March 14, 2014, 03:51:03 AM
That's just resharper whining. Generally, for stuff like that it can be nice to initialize the field to null in code, since it removes the somewhat silly warning.

Visual studio is a little iffy on detecting whether or not things are set from the inspector.
Title: Re: NGUI warnings
Post by: mathiassoeholm on March 14, 2014, 09:52:11 AM
Yup, it's Resharper!

Would be cool if the fields were explicitly initialized to null so Resharper would shut up :-)
But then again, it's only a Resharper problem..