Author Topic: Let NGUI Button pass int/string/bool arguments?  (Read 4146 times)

Chaosgod_Espér

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Let NGUI Button pass int/string/bool arguments?
« on: November 19, 2014, 04:04:08 AM »
hi there..

Just a quick Question:

What would be the easiest way to let a Button pass ints, strings, bools, floats..etc a s argument to an onClick notifier?
Cause the "Arg 0" position in the inspector only allows Drag&Drop objects into, but not setting such values.

See:

http://fs1.directupload.net/images/141119/rvyr3cpy.png

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Let NGUI Button pass int/string/bool arguments?
« Reply #1 on: November 19, 2014, 03:47:43 PM »
The property binding system that comes with NGUI doesn't let you specify values. It can only bind properties to other properties (or fields).

NMD

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Let NGUI Button pass int/string/bool arguments?
« Reply #2 on: December 23, 2015, 03:42:52 PM »
Same question, disappointing. Needed to add in something real quick to an existing UI and this would have worked great.

The new built in Unity system does it that way btw, where you can give it an int in the inspector.

My Quick Fix: I added a new component to the button that only contains a public int property. Pass the button as Arg0 and select the component and property.
« Last Edit: December 23, 2015, 04:05:19 PM by NMD »