Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: sintua on August 13, 2012, 05:45:30 AM

Title: Using Event Listeners?
Post by: sintua on August 13, 2012, 05:45:30 AM
I'm sure the functionality is in here, and I'm seeing pieces, but I cant quite figure it out...

Basically, I'm making a whole bunch of buttons and it seems kind of silly to attach a script to all of them that does the exact same thing: tells the menuHandlerScript which button was clicked.

I was udner the impression clicking any button sends out an event, so how do I just have a script that listens for any onClick event then - by reading what gameobject/whatever was clicked, reacts?
Title: Re: Using Event Listeners?
Post by: ArenMook on August 13, 2012, 08:38:13 AM
You can use UIEventListener.Get(buttonGameObject).onClick += CallbackFunction;