} // ends the Update() function /// <summary> /// This function handles the switching of states. /// </summary> /// <param name="newState"> The state that the boss will be switching to. </param> private void SwitchToState(BossState newState) { if (newState != null) { if(currentState != null) currentState.OnEnd(this); currentState = newState; currentState.OnStart(this); } // ends the if statement } // ends the SwitchToState() function
private void SwitchToState(BossState newState) { if (newState != null) { if (currentState != null) { currentState.OnEnd(this); } currentState = newState; currentState.OnStart(this); } }