Beispiel #1
0
    void Update()
    {
        if (playerInputEnabled)
        {
            inputPrev = input;
            input.y   = InputWrapper.GetVerticalAxis();
            input.x   = InputWrapper.GetHorizontalAxis();

            if (chargingSlash)
            {
                ChargeSlash();
            }

            if (savedSlashCharge > 0)
            {
                ApplySlashDistance();
            }
            else
            {
                Move();
                if (Input.GetKeyDown(KeyCode.Space))
                {
                    BeginSlash();
                }
                if (Input.GetKeyUp(KeyCode.Space) && chargingSlash)
                {
                    ReleaseSlash();
                }
            }
        }
    }