Author Topic: NGUI warnings  (Read 5022 times)

mathiassoeholm

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 35
    • View Profile
NGUI warnings
« 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI warnings
« Reply #1 on: March 12, 2014, 06:05:27 PM »
Those are serialized fields, set by Unity. What version of Unity are you seeing that in?

mathiassoeholm

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 35
    • View Profile
Re: NGUI warnings
« Reply #2 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.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI warnings
« Reply #3 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.

mathiassoeholm

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 35
    • View Profile
Re: NGUI warnings
« Reply #4 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..