} // ends the Start() function /// <summary> /// This function updates the boss every frame. /// </summary> void Update() { // if there is no current state, set it to idle if (currentState == null) SwitchToState(new BossStateIdle()); // if there is a current state, update the state if (currentState != null) SwitchToState(currentState.Update(this)); } // ends the Update() function
void Update() { if (currentState == null) { SwitchToState(new BossStateIdle()); } if (currentState != null) { SwitchToState(currentState.Update(this)); } }