Support => NGUI 3 Support => Topic started by: bodosaher on September 11, 2013, 06:43:48 PM
Title: How do I know the button is being pressed?
Post by: bodosaher on September 11, 2013, 06:43:48 PM
I need to know if a button is being pressed, I dont a method that is being called as long as the button is held down? Does onPress do that because i feel it only simulates the first click?
Title: Re: How do I know the button is being pressed?
Post by: Wumpee on September 11, 2013, 07:20:29 PM
OnPress is only called when the button is initially pressed, or when it is released.
You could do something like the following if you want to know when the button is held down:
publicbool Held {get;protectedset;}
void OnPress(bool pressed)
{
Held = pressed;
}
Title: Re: How do I know the button is being pressed?
Post by: bodosaher on September 11, 2013, 07:34:11 PM