Hey community,
in my current Android app made in Unity 4.6 I use the new Gui System. The new Button has its On Click() event which is working fine. But if the player is releasing the button the main charakter just walks endless further.
I tried to use the WaitForSecounds() methode to reset the button in a way, but it isnt working.
This is my code so far:
using UnityEngine;
using System.Collections;
public class UIcontroller : MonoBehaviour
{
public bool pressedD = false;
public bool pressedU = false;
IEnumerator Wait(){
yield return new WaitForSeconds (3.0f);
}
public void ButtonDOWNpresser() //Called from the OnClick() section of the GUI button
{
pressed1 = true;
StartCoroutine(Wait());
pressed1 = false;
}
public void ButtonUPpresser()
{
pressedU = true;
StartCoroutine(Wait());
pressedU = false;
}
}
Is there no On Release() section to the On Click() section for the GUI button?
Thank you very much for your help!