Author Topic: Event arguments in Inspector with Unity 4.5.1  (Read 3375 times)

Aze

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
Event arguments in Inspector with Unity 4.5.1
« on: June 18, 2014, 05:56:39 AM »
Hello!

First, thanks for the great work you do on last NGUI updates!

I'm on Unity 4.5, and some new elements are serialized, like structs. Maybe that's why we now can now manually set arguments for events on components like UIButton's OnClick().
Unfortunately, no default values are set within the Inspector for these arguments, so if you hit Unity's Play button, I get errors saying "failed to convert parameters", which makes sens.

To illustrate this, in the example below, I have to find a bool that is set to true somewhere in my other components if I want to play a tween forward:



Would you have an easy way to avoid having to set these parameters manually in the inspector for each event?
Or is that normal? It didn't seem to be like that in previous versions.

Thank you ;)
« Last Edit: June 18, 2014, 07:32:45 AM by Aze »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Event arguments in Inspector with Unity 4.5.1
« Reply #1 on: June 18, 2014, 03:47:44 PM »
All property bindings are property-to-property, meaning you can't specify a value in the inspector such as "true" or "false". Adding support for that is a planned feature.

This is why the tween has PlayForward() and PlayReverse() btw.