Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Tatanan on September 11, 2014, 04:22:28 AM
-
I have been using UI Event Trigger to handle events on my sprites, but I am starting to guess I'm doing it wrong.
Why should I use UI Event Trigger (or even UI Button) if UI Camera is sending events and can get them on my scritps?
-
UIEventTrigger can be used to trigger a remote function once an event you want arrives. It's the same thing as writing a script with the event function inside of it, such as OnClick, and doing the logic inside. Event trigger lets you have a cleaner approach where you don't need to write custom components for every button, but simply choose a function to call instead.
If you already have a custom script attached, don't use UIEventTrigger. If you want to trigger a function on a different game object, use UIEventTrigger.