Ejemplo n.º 1
0
        public void HandleInput()
        {
            FocusableObject currentFocusableObject = FocusableObject.CurrentObject;

            if (Input.GetButtonDown("Submit"))
            {
                Debug.Log("Submit");
                currentFocusableObject.OnSubmit();
            }

            if (Input.GetButtonDown("Cancel"))
            {
                Debug.Log("Cancel");
                currentFocusableObject.OnCancel();
            }

            if (Input.GetButtonDown("Fire3"))
            {
                Debug.Log("Fire3");
                currentFocusableObject.OnInformation();
            }

            float horizontal = Input.GetAxis("Horizontal");
            float vertical   = Input.GetAxis("Vertical");

            if (horizontal != 0f || vertical != 0f)
            {
                Debug.Log("Arrow");
                FocusableObject.CurrentObject.OnArrow(horizontal, vertical);
                System.Threading.Thread.Sleep(50);
            }
        }
Ejemplo n.º 2
0
 public IEnumerator Submit(FocusableObject focusableObject)
 {
     focusableObject.OnSubmit();
     yield return(null);
 }