public void SetState(PlayState state) { if (currentState != null) { currentState.Exit(); } currentState = state; if (currentState != null) { currentState.Enter(); } }