Ejemplo n.º 1
0
 private void PlungerInput()
 {
     if (UnityEngine.Input.touchCount == 1)
     {
         Touch touch = UnityEngine.Input.GetTouch(0);
         if (IsTouchInPlungerArea(touch.position))
         {
             if (touch.phase == TouchPhase.Began)
             {
                 StartPlunger.Invoke(touch.position);
             }
             else if (touch.phase == TouchPhase.Ended)
             {
                 ShootPlunger.Invoke(touch.position);
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void DebugInput()
        {
            if (UnityEngine.Input.GetKeyDown(KeyCode.A))
            {
                OnPaddleLeftDown?.Invoke();
            }
            if (UnityEngine.Input.GetKeyUp(KeyCode.A))
            {
                OnPaddleLeftUp?.Invoke();
            }

            if (UnityEngine.Input.GetKeyDown(KeyCode.D))
            {
                OnPaddleRightDown?.Invoke();
            }
            if (UnityEngine.Input.GetKeyUp(KeyCode.D))
            {
                OnPaddleRightUp?.Invoke();
            }


            // if (UnityEngine.Input.GetKey(KeyCode.Space))
            // {
            //     OnNudge?.Invoke();
            // }

            if (UnityEngine.Input.GetKeyDown(KeyCode.Space))
            {
                StartPlunger?.Invoke(new Vector3(0, 1, 0));
            }

            if (UnityEngine.Input.GetKeyUp(KeyCode.Space))
            {
                ShootPlunger?.Invoke(new Vector3(0, -10000, 0));
            }
        }