Example #1
0
    protected override void AIUpdate_detect()
    {
        base.AIUpdate_detect();
        float rand = GetAIRandomNumver();

        switch (aiState)
        {
        case AISTATE.AISELECT:
            if (rand < AddAIProbNum(aiStateNum_walk))
            {
                SetAIState(AISTATE.APPROACH_WALK, 6.0f);
            }
            else if (rand < AddAIProbNum(aiStateNum_dash))
            {
                SetAIState(AISTATE.APPROACH_DASH, 6.0f);
            }
            else if (rand < AddAIProbNum(aiStateNum_attack))
            {
                SetAIState(AISTATE.ATTACK, 4.0f);
            }
            else
            {
                SetAIState(AISTATE.WAIT, 4.0f);
                animator.SetTrigger("rest");
            }
            break;

        case AISTATE.APPROACH_WALK:
            if (EnemyCtrl_antiFly.MoveToPlayer_X(10.0f, moveSpeed * 0.5f))
            {
                SetAIState(AISTATE.ATTACK, 20.0f);
            }
            break;

        case AISTATE.APPROACH_DASH:
            if (EnemyCtrl_antiFly.MoveToPlayer_X(10.0f, moveSpeed))
            {
                SetAIState(AISTATE.ATTACK, 4.0f);
            }
            break;

        case AISTATE.ATTACK:
            break;

        case AISTATE.WAIT:
            break;
        }
    }
Example #2
0
    protected override void AIUpdate_antiFly_detect()
    {
        base.AIUpdate_antiFly_detect();
        switch (aiState)
        {
        case AISTATE.AISELECT:
            SetAIState(AISTATE.APPROACH_DASH, 3.0f);
            break;

        case AISTATE.APPROACH_DASH:
            if (EnemyCtrl_antiFly.MoveToPlayer_X(1.0f, moveSpeed))
            {
                SetAIState(AISTATE.ATTACK, 4.0f);
            }
            break;
        }
    }