public override void StartFSM() { _idleState = new IdleState <states>(this, flags, _treeStartPoint); _followState = new FollowState <states>(this, myLeader, flags, _treeStartPoint, stopDist); _attackState = new AttackState <states>(this, flags, _treeStartPoint); _escapeState = new EscapeState <states>(this, flags, _treeStartPoint); _reloadState = new ReloadState <states>(this, flags, _treeStartPoint); fsm = new FSM <states>(_idleState); _idleState.AddTransition(states.Follow, _followState); _idleState.AddTransition(states.Attack, _attackState); _idleState.AddTransition(states.Escape, _escapeState); _idleState.AddTransition(states.Reload, _reloadState); _followState.AddTransition(states.Idle, _idleState); _followState.AddTransition(states.Attack, _attackState); _followState.AddTransition(states.Escape, _escapeState); _followState.AddTransition(states.Reload, _reloadState); _attackState.AddTransition(states.Idle, _idleState); _attackState.AddTransition(states.Follow, _followState); _attackState.AddTransition(states.Escape, _escapeState); _attackState.AddTransition(states.Reload, _reloadState); _reloadState.AddTransition(states.Idle, _idleState); _reloadState.AddTransition(states.Attack, _attackState); _reloadState.AddTransition(states.Follow, _followState); _reloadState.AddTransition(states.Escape, _escapeState); _escapeState.AddTransition(states.Idle, _idleState); _escapeState.AddTransition(states.Follow, _followState); fsm.SetState(_idleState); }
public override void StartFSM() { _leadState = new LeadState <states>(this, flags, leadStopDistance, _treeStartPoint); _attackState = new AttackState <states>(this, flags, _treeStartPoint); _buffState = new BuffState <states>(this, flags, _treeStartPoint); _escapeState = new EscapeState <states>(this, flags, _treeStartPoint); _idleState = new IdleState <states>(this, flags, _treeStartPoint); _reloadState = new ReloadState <states>(this, flags, _treeStartPoint); fsm = new FSM <states>(_idleState); _idleState.AddTransition(states.Attack, _attackState); _idleState.AddTransition(states.Buff, _buffState); _idleState.AddTransition(states.Lead, _leadState); _idleState.AddTransition(states.Escape, _escapeState); _idleState.AddTransition(states.Reload, _reloadState); _leadState.AddTransition(states.Attack, _attackState); _leadState.AddTransition(states.Buff, _buffState); _leadState.AddTransition(states.Escape, _escapeState); _leadState.AddTransition(states.Idle, _idleState); _leadState.AddTransition(states.Reload, _reloadState); _attackState.AddTransition(states.Lead, _leadState); _attackState.AddTransition(states.Buff, _buffState); _attackState.AddTransition(states.Escape, _escapeState); _attackState.AddTransition(states.Idle, _idleState); _attackState.AddTransition(states.Reload, _reloadState); _reloadState.AddTransition(states.Idle, _idleState); _reloadState.AddTransition(states.Attack, _attackState); _reloadState.AddTransition(states.Buff, _buffState); _reloadState.AddTransition(states.Lead, _leadState); _reloadState.AddTransition(states.Escape, _escapeState); _buffState.AddTransition(states.Lead, _leadState); _buffState.AddTransition(states.Attack, _attackState); _buffState.AddTransition(states.Escape, _escapeState); _buffState.AddTransition(states.Idle, _idleState); _buffState.AddTransition(states.Reload, _reloadState); _escapeState.AddTransition(states.Idle, _idleState); _escapeState.AddTransition(states.Lead, _leadState); fsm.SetState(_idleState); }