internal void ChangeState(eAI_State newState) { if (currentState != null) { currentState.ExitState(); } currentState = states[(int)newState]; currentState.EnterState(); }
public override void Update(UpdateTickedEventArgs e) { me.farmerPassesThrough = true; PathfindingNodeUpdateCheck(); MovementAndAnimationUpdate(); aggroMonster = CheckAggroRadiusForMonsters(); eAI_State potentialNewState = TransitionsCheck(); if (potentialNewState != eAI_State.nil) { machine.ChangeState(potentialNewState); return; } if (e.IsMultipleOf(15)) { PathfindingRemakeCheck(); } }