void FSMInit() { _fsm = new FSM <States>(); var follow = new FollowState <States>(FlockingRun, _model, _minionState, criticalHealthAmount, team, _root); var attack = new AttackState <States>(_model, _minionState, shootCD, team, criticalHealthAmount, _root); var flee = new FleeState <States>(SetupPathfinding, Run, _model, _minionState, secureZone, secureHealthAmount, distToSecureZone, _root); follow.AddTransitionState(States.Attack, attack); follow.AddTransitionState(States.Flee, flee); attack.AddTransitionState(States.Follow, follow); attack.AddTransitionState(States.Flee, flee); flee.AddTransitionState(States.Follow, follow); _fsm.SetInit(follow); }
void FSMInit() { _fsm = new FSM <States>(); var move = new MoveState <States>(SetupPathfinding, Run, _model, _leaderState, goal, criticalHealthAmount, team, distToGoal, _root); var attack = new AttackState <States>(_model, _leaderState, shootCD, team, criticalHealthAmount, _root); var flee = new FleeState <States>(SetupPathfinding, Run, _model, _leaderState, secureZone, secureHealthAmount, distToSecureZone, _root); var idle = new IdleState <States>(_model, _leaderState, goal, distToGoal, criticalHealthAmount, team, _root); move.AddTransitionState(States.Idle, idle); move.AddTransitionState(States.Attack, attack); move.AddTransitionState(States.Flee, flee); attack.AddTransitionState(States.Move, move); attack.AddTransitionState(States.Flee, flee); flee.AddTransitionState(States.Move, move); idle.AddTransitionState(States.Move, move); idle.AddTransitionState(States.Flee, flee); idle.AddTransitionState(States.Attack, attack); _fsm.SetInit(move); }