Example #1
0
    virtual protected void InitState()
    {
        State idleState = new IdleState();

        idleState.Init(this);
        _stateDictionary.Add(eState.IDLE, idleState);

        State moveState = new MoveState();

        moveState.Init(this);
        _stateDictionary.Add(eState.MOVE, moveState);

        State attackState = new AttackState();

        attackState.Init(this);
        _stateDictionary.Add(eState.ATTACK, attackState);

        State chaseState = new ChaseState();

        chaseState.Init(this);
        _stateDictionary.Add(eState.CHASE, chaseState);

        State patrolState = new PatrolState();

        patrolState.Init(this);
        _stateDictionary.Add(eState.PATROL, patrolState);
    }
Example #2
0
    virtual protected void InitState()
    {
        State idleState   = new IdleState();
        State moveState   = new MoveState();
        State attackState = new AttackState();
        State chaseState  = new ChaseState();


        idleState.Init(this);
        moveState.Init(this);
        attackState.Init(this);
        chaseState.Init(this);

        _stateList.Add(eState.IDLE, idleState);
        _stateList.Add(eState.MOVE, moveState);
        _stateList.Add(eState.ATTACK, attackState);
        _stateList.Add(eState.CHASE, chaseState);
    }
    virtual protected void InitState()
    {
        //데이터 주도 프로그래밍: 스크립트로 다 빼기
        State idleState   = new IdleState();
        State moveState   = new MoveState();
        State chaseState  = new ChaseState();
        State attackState = new AttackState();
        State patrolState = new PatrolState();

        idleState.Init(this);
        moveState.Init(this);
        chaseState.Init(this);
        attackState.Init(this);
        patrolState.Init(this);

        _stateMap.Add(eState.IDLE, idleState);
        _stateMap.Add(eState.MOVE, moveState);
        _stateMap.Add(eState.CHASE, chaseState);
        _stateMap.Add(eState.ATTACK, attackState);
        _stateMap.Add(eState.PATROL, patrolState);
    }
Example #4
0
    protected override void InitState()
    {
        State idleState = new WargIdleState();

        idleState.Init(this);
        _stateList.Add(eState.IDLE, idleState);

        State patrolState = new PatrolState();

        patrolState.Init(this);
        _stateList.Add(eState.PATROL, patrolState);

        State chaseState = new ChaseState();

        chaseState.Init(this);
        _stateList.Add(eState.CHASE, chaseState);

        State attackState = new AttackState();

        attackState.Init(this);
        _stateList.Add(eState.ATTACK, attackState);
    }