public void SetState(CameraState newState) { if (state != null) { state.OnStateExit(); } state = newState; if (state != null) { state.OnStateEnter(); } }
public void SetState(CameraState state) { if (currentState != null) { currentState.OnStateExit(); } currentState = state; gameObject.name = "Camera - " + state.GetType().Name; if (currentState != null) { currentState.OnStateEnter(); } }
public void SetState(CameraState state) { if (currentState != null) { currentState.OnStateExit(); } currentState = state; if (currentState != null) { currentState.Init(); currentState.OnStateEnter(); } }