void FixedUpdate()
 {
     if (Input.GetButtonDown("Jump"))
     {
         playerPhysics.Attack();
     }
     playerPhysics.Move();
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (!PauseMenu.gameIsPaused)
        {
            switch (PlayerID)
            {
            case 1:
                if (Input.GetKeyDown((KeyCode)jumpBP1))
                {
                    _myPhysics.Jump();
                }

                if (Input.GetKeyDown((KeyCode)slideBP1))
                {
                    _myPhysics.Slide();
                }

                if (Input.GetKeyDown((KeyCode)attackBP1))
                {
                    _myPhysics.Attack();
                }

                if (Input.GetKeyDown((KeyCode)dashBP1))
                {
                    _myPhysics.Dash();
                }
                break;

            case 2:
                if (Input.GetKeyDown((KeyCode)jumpBP2))
                {
                    _myPhysics.Jump();
                }

                if (Input.GetKeyDown((KeyCode)slideBP2))
                {
                    _myPhysics.Slide();
                }

                if (Input.GetKeyDown((KeyCode)attackBP2))
                {
                    _myPhysics.Attack();
                }

                if (Input.GetKeyDown((KeyCode)dashBP2))
                {
                    _myPhysics.Dash();
                }
                break;

            case 3:
                if (Input.GetKeyDown((KeyCode)jumpBP3))
                {
                    _myPhysics.Jump();
                }

                if (Input.GetKeyDown((KeyCode)slideBP3))
                {
                    _myPhysics.Slide();
                }

                if (Input.GetKeyDown((KeyCode)attackBP3))
                {
                    _myPhysics.Attack();
                }

                if (Input.GetKeyDown((KeyCode)dashBP3))
                {
                    _myPhysics.Dash();
                }
                break;

            case 4:
                if (Input.GetKeyDown((KeyCode)jumpBP4))
                {
                    _myPhysics.Jump();
                }

                if (Input.GetKeyDown((KeyCode)slideBP4))
                {
                    _myPhysics.Slide();
                }

                if (Input.GetKeyDown((KeyCode)attackBP4))
                {
                    _myPhysics.Attack();
                }

                if (Input.GetKeyDown((KeyCode)dashBP4))
                {
                    _myPhysics.Dash();
                }
                break;

            default:
                Debug.Log("[PlayerController] t'as oublié le playerID ");
                break;
            }
        }
    }