public void ChangeState(string newState, bool startState = true) { Debug.Log("Changing States: AudienceState-" + newState); switch (newState) { case "Idle": currentState = idleState; break; case "Focused": currentState = focusedState; break; case "Exit": currentState = exitState; break; } if (startState) { currentState.StartState(this); } }
public void ChangeState(AudienceStates newState, bool startState = true) { switch (newState) { case AudienceStates.AUDIENCE_IDLE: currentState = idleState; break; case AudienceStates.AUDIENCE_FOCUSED: currentState = focusedState; break; case AudienceStates.AUDIENCE_EXIT: currentState = exitState; break; } if (startState) { currentState.StartState(this); } }