Esempio n. 1
0
 protected virtual void InitStateMachine()
 {
     _stateMachine       = gameObject.AddComponent <CharacterStateMachine>();
     _stateMachine.Debug = true;
     _stateMachine.SetDelegateForState(CharacterState.PRE_INIT, Init);
     _stateMachine.SetDelegateForState(CharacterState.INIT_MOVE, InitMove);
     _stateMachine.SetDelegateForState(CharacterState.MOVE_TO, MoveTo);
     _stateMachine.SetDelegateForState(CharacterState.MOVE_COMPLETE, OnMoveComplete);
 }
Esempio n. 2
0
 protected virtual void InitStateMachine()
 {
     _stateMachine       = gameObject.AddComponent <CharacterStateMachine>();
     _stateMachine.Debug = true;
     _stateMachine.SetDelegateForState(CharacterState.PRE_INIT, Init);
     _stateMachine.SetDelegateForState(CharacterState.SEARCHING_FOR_TARGET, FindNewTarget);
     _stateMachine.SetDelegateForState(CharacterState.INIT_ATTACK, InitAttack);
     _stateMachine.SetDelegateForState(CharacterState.ATTACKING, DoAttack);
     _stateMachine.SetDelegateForState(CharacterState.ATTACK_COMPLETE, OnAttackComplete);
 }