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); }
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); }
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); }