예제 #1
0
    private void Update()
    {
        characterPhysics.inputDirectionRaw = GetMoveDirection();
        pressCommand = CreatePressCommand(inputKeys);

        if (characterPhysics.currentGravityState == GravityState.OnWall)
        {
            // Need to calculate direction on wall differently
            characterPhysics.inputDirection = wallInteraction.CalculateDirectiOnOnWall(characterPhysics.inputDirectionRaw);

            if (pressCommand.Equals(jumpCommand))
            {
                wallInteraction.JumpOffWall();
            }
        }
        else
        {
            doublePressCommand = CreateDoublePressCommand(inputKeys);

            // Check for Dash Command
            if (doublePressCommand.Equals(dashBackwardCommand))
            {
                dash.CastDash(characterPhysics.inputDirectionRaw);
            }
            else if (doublePressCommand.Equals(dashForwardCommand))
            {
                dash.CastDash(characterPhysics.inputDirectionRaw);
            }
            else if (doublePressCommand.Equals(dashRightCommand))
            {
                dash.CastDash(characterPhysics.inputDirectionRaw);
            }
            else if (doublePressCommand.Equals(dashLeftCommand))
            {
                dash.CastDash(characterPhysics.inputDirectionRaw);
            }

            if (pressCommand.Equals(jumpCommand))
            {
                jump.CastJump();
            }

            if (pressCommand.Equals(lightAttackCommand))
            {
                lightAttack.Cast();
            }

            if (pressCommand.Equals(stunTargetCommand))
            {
                stunTarget.Cast();
            }

            if (pressCommand.Equals(immobilizeTargetCommand))
            {
                immobilizeTarget.Cast();
            }

            if (pressCommand.Equals(throwUpTargetCommand))
            {
                throwUpTarget.Cast();
            }
        }
    }