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