Пример #1
0
    void InputToVelocity()
    {
        moveVec = Vector2.zero;

        float currentMoveSpeed;

        animationController.GetCurrentState();
        if (animationController.animationHashes.hs_Current == animationController.animationHashes.hs_Dash || animationController.animationHashes.hs_Current == animationController.animationHashes.hs_Air_Dash)
        {
            currentMoveSpeed = dashForce;
            moveVec.x        = (inputVec.x == 0 ? Mathf.Sign(transform.localScale.x) : inputVec.x) * currentMoveSpeed;
        }
        else
        {
            currentMoveSpeed = moveSpeed;
            moveVec.x        = inputVec.x * currentMoveSpeed;
        }

        if (animationController.animationHashes.hs_Current == animationController.animationHashes.hs_Air_Dash)
        {
            verticalVelocity = 0;
        }

        moveVec.y = verticalVelocity;

        moveVec = moveVec * Time.deltaTime;
    }