public override void LogicUpdate()
    {
        base.LogicUpdate();

        if (performCloseRangeAction)
        {
            enemy.ChooseCombo();
        }
        else if (performLongRangeAction)
        {
            switch (Random.Range(1, 3)) // Random moveset
            {
            case 1:                     // CHARGE
                stateMachine.ChangeState(enemy.chargeState);
                break;

            case 2:     // DODGE
                stateMachine.ChangeState(enemy.dodgeState);
                break;
            }
        }
        else if (!isPlayerInMaxAgroRange)
        {
            stateMachine.ChangeState(enemy.moveState);
        }
    }
Ejemplo n.º 2
0
    public override void LogicUpdate()
    {
        base.LogicUpdate();

        if (performCloseRangeAction)
        {
            enemy.ChooseCombo();
        }
        else if (isDetectingWall || !isDetectingGround)
        {
            stateMachine.ChangeState(enemy.moveState);
        }
        else if (isChargeTimeOver)
        {
            if (isPlayerInMinAgroRange)
            {
                stateMachine.ChangeState(enemy.playerDetectedState);
            }
            else
            {
                stateMachine.ChangeState(enemy.moveState);
            }
        }
    }
    public override void LogicUpdate()
    {
        base.LogicUpdate();

        if (isDodgeOver)
        {
            if (isPlayerInMaxAgroRange && performCloseRangeAction)
            {
                enemy.ChooseCombo();
            }
            else if (isPlayerInMaxAgroRange && !performCloseRangeAction)
            {
                stateMachine.ChangeState(enemy.dodgeState);
            }
            else if (!isPlayerInMaxAgroRange)
            {
                stateMachine.ChangeState(enemy.moveState);
            }
        }
        else
        {
            enemy.CreateAfterImage();
        }
    }