Пример #1
0
    void Awake()
    {
        FSM         = new FiniteStateMachine <EnemyController>();
        stateAttack = new EnemyStateAttack();
        stateDie    = new EnemyStateDie();
        stateMove   = new EnemyStateMove();

        enemyAnimation = this.GetComponentInChildren <EnemyAnimation>();
        enemyAttack    = this.GetComponentInChildren <EnemyAttack>();

        StateAction    = EEnemyStateAction.MOVE;
        StateDirection = EDirection.NONE;
    }
Пример #2
0
    public EnemyStateBase Create(EnemyAI.STATE state)
    {
        EnemyStateBase ret = null;

        switch (state)
        {
        case EnemyAI.STATE.ATTACK:
            ret = new EnemyStateAttack(this.obj, this.finder, this.dashSpeed, dashRotSpeed);
            break;

        case EnemyAI.STATE.BREAKTIME:
            ret = new EnemyStateBreaktime(this.obj, this.finder, this.breakInterval);
            break;

        case EnemyAI.STATE.SEARCH:
            ret = new EnemyStateSearch(this.obj, this.finder, this.actionNum);
            break;
        }

        return(ret);
    }