GUITexture buttons in Android are too sensitive

I am making an android game. I use GUITexture to make buttons. But for some of the buttons, when it is tested on an Android phone using apk file, the button pushed make another button in same position in the next scene or another button which will transform to the same position pushed. I use System.Threading.Thread.Sleep to make some delay to prevent this but some doesn’t work especially for the buttons which will transform. How can I solve this problem?

Perhaps you should do your changes when the button is unpressed. For example, getting key events, Input.GetKeyDown fires when the button is pressed down, Input.GetKeyUp fires when the key is released. I think you need to implement something similar for your buttons.

To implement this, it seems like having two boolean flags should work:



       btnPressed= true
   if(wasBtnPressed && !btnPressed)
       //change buttons

   wasBtnPressed = btnPressed

That way, wasBtnPressed tells you if the button was down last frame. If it was down last frame, but not this frame, then the button has been released.