Esempio n. 1
0
        public void OnPaddleDown(Vector2 inputValue)
        {
            var point = inputValue;

            if (point.x <= screen_w / 2)
            {
                OnPaddleLeftUp?.Invoke();
            }
            else
            {
                OnPaddleRightUp?.Invoke();
            }
        }
Esempio 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));
            }
        }