public void ChangeState(SO_State newState) { if (newState == null) { return; } if (CurrentState != null) { // Performing Exit Actions CurrentState.ExitState(this); } CurrentState = newState; // Performing Enter actions CurrentState.EnterState(this); }
public PluggableStateMachine(GameObject ownerGameObject, SO_State defaultState) { gameObject = ownerGameObject; ChangeState(defaultState); _IsActive = true; }