public void Dispose() { ModEntry.modHelper.Events.Player.Warped -= Player_Warped; if (currentState != null) { currentState.ExitState(); } currentState = null; states = null; owner = null; }
public AI_StateMachine(RecruitedState owner) { this.owner = owner; states = new AI_State[3]; states[0] = new AI_StateFollowCharacter(owner.stateMachine.companion, owner.stateMachine.manager.farmer, this); states[1] = new AI_StateAggroEnemy(owner.stateMachine.companion, owner.stateMachine.manager.farmer, this); states[2] = new AI_StateIdle(owner.stateMachine.companion, owner.stateMachine.manager.farmer, this); bools = new Dictionary <string, bool>(); ChangeState(eAI_State.followFarmer); ModEntry.modHelper.Events.Player.Warped += Player_Warped; }