Author Topic: Unnecessary warning - UIButtonColor  (Read 1258 times)

mathiassoeholm

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 35
    • View Profile
Unnecessary warning - UIButtonColor
« on: February 10, 2014, 05:24:51 AM »
Hey there!

I'm adding a UIButtonColor component during runtime, and then afterwards setting the tweenTarget to a child gameobject.

So like this:
  1. var buttonColor = gameObject.AddComponent<UIButtonColor>();
  2. buttonColor.tweenTarget = highlightGo;

Now Init will be called on the UIButtonColor component before the tween target is set, since Init is called in Awake.
If the gameobject with the UIButtonColor component on it doesn't have a widget, renderer or light on it, the warning on Line 139 (In UIButtonColor.cs) will be logged.

I'm using this several places, so I get a lot of annoying warnings.

It's not a huge deal, but I feel like I should be able to set the tween target before it yells at me :-)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unnecessary warning - UIButtonColor
« Reply #1 on: February 10, 2014, 05:02:55 PM »
Thanks for pointing that out. I'll patch it for the next update.