Beispiel #1
0
    void Update()
    {
        //  COMBAT CONTROLS
        if (Input.GetMouseButton(0) && playerMovement.IsGrounded() && !playerCombat.GetWeaponSheathed())
        {
            playerCombat.StartAttack();
        }

        if (Input.GetButtonDown("Sheath"))
        {
            playerCombat.ToggleSheath();
        }

        //  DASH CONTROLS
        if (Input.GetKey(KeyCode.LeftShift))
        {
            if (Input.GetKeyDown(KeyCode.W))
            {
                playerCombat.DashForward();
            }
            if (Input.GetKeyDown(KeyCode.S))
            {
                playerCombat.DashBackward();
            }
        }



        //  MOVEMENT CONTROLS
        if (!playerCombat.isAttacking)
        {
            playerMovement.Move();
        }

        if (Input.GetButtonDown("Jump") && playerMovement.IsGrounded())
        {
            playerMovement.StartJump();
        }

        playerMovement.Rotate();
    }