Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Der_Kevin on June 10, 2014, 03:13:15 AM
-
Hey guys!
I have a question about how i can trigger an NGUI onscreen Button Press.
at the moment i have the following behavior:
I am entering a box collider with trigger and the red dot on top of the barrel is turning into the same graphic as the onscreen button, works perfect so far.
(https://dl.dropboxusercontent.com/u/52617394/trigger.png)
so, i have this red circle that indicates that you can interact with the object and when you are in the area of the trigger, it just gets bigger. what i want to do now is, that i can press the big A button on the down right and it throws out a debug message.
how can i let the NGUI button and the trigger interact with each other? I think i have to put "some" script on that trigger and not on the button right?
Greets,
Kevin
-
This wouldn't be NGUI-related. It's gameplay code. Singleton for the current object that you're standing next to -- set the value when you enter the trigger, remove it when you leave the trigger. When you press the button, work with the current singleton value.