Author Topic: Trigger NGUI Button pressing  (Read 2266 times)

Der_Kevin

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 10
    • View Profile
Trigger NGUI Button pressing
« 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.




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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Trigger NGUI Button pressing
« Reply #1 on: June 11, 2014, 04:17:55 AM »
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.