Exemple #1
0
 protected override void OnStateEntered(IAIStateMachine machine, IAIState lastState)
 {
     if (_defaultState is IAIState)
     {
         _stateMachine.ChangeState(_defaultState as IAIState);
     }
 }
Exemple #2
0
 protected override void OnStateExited(IAIStateMachine machine, IAIState nextState)
 {
     if (_stateMachine.Current != null)
     {
         _stateMachine.ChangeState((IAIState)null);
     }
 }
Exemple #3
0
 public AIStateMachine(IAIStateMachine owner)
 {
     _owner = owner ?? this;
 }
Exemple #4
0
 public AIStateMachine()
 {
     _owner = this;
 }
 void IAIState.OnStateEntered(IAIStateMachine machine, IAIState lastState)
 {
     _isActive = true;
     this.OnStateEntered(machine, lastState);
     _onEnterState.ActivateTrigger(this, null);
 }
 void IAIState.OnStateExited(IAIStateMachine machine, IAIState nextState)
 {
     this.OnStateExited(machine, nextState);
     _isActive = false;
     _onExitState.ActivateTrigger(this, null);
 }
 protected abstract void OnStateExited(IAIStateMachine machine, IAIState nextState);
 void IAIState.Init(IAIStateMachine machine)
 {
     this.StateMachine = machine;
 }
 protected virtual void OnInit(IAIStateMachine machine)
 {
 }
 protected abstract void OnStateEntered(IAIStateMachine machine, IAIState lastState);
 void IAIState.Init(IAIStateMachine machine)
 {
     this.StateMachine = machine;
     this.OnInit(machine);
 }
Exemple #12
0
 void IAIState.OnStateExited(IAIStateMachine machine, IAIState nextState)
 {
     this.OnStateExited(machine, nextState);
     _isActive = false;
 }
Exemple #13
0
 void IAIState.OnStateExited(IAIStateMachine machine, IAIState nextState)
 {
     _loop.Reset();
     this.OnStateExited(machine, nextState);
     _isActive = false;
 }
Exemple #14
0
 protected virtual void OnStateExited(IAIStateMachine machine, IAIState nextState)
 {
 }
Exemple #15
0
 protected virtual void OnStateEntered(IAIStateMachine machine, IAIState lastState)
 {
 }