I feel like Im missing something really simple, but Ive read about all the events NGUI can generate from an object and just dont get where to recive (or handle) the event. Do I just attach it to a script on the object?
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
Yup. You can also look into add-on frameworks like NData, which is a MVVM data manager which can simplify a lot of UI code (and complicate other UI code; use the right tool for the job and all that jazz). |
|||||
|
|
Some of the NGUI widget scripts have delegates to handle events, I just modified the rest to let me supply event handlers - ie. added a buttonClickDelegate and buttonHoldDelegate to UIButton |
|||
|
|
|
The easiest way to handle UI Events in NGUI is to use the UIEventListener class. All you have to do is call it like this:
|
|||
|
|