public bool ChangeRoom(R room) { if (_transitionHandler != null && _transitionHandler.IsInProcess) { return(false); } if (CurrentRoom != null) { if (OnBeforeRoomClosed != null) { OnBeforeRoomClosed.Invoke(CurrentRoom); } } _followingRoom = room; if (_transitionHandler == null) { if (OnAfterRoomOpened != null) { OnAfterRoomOpened.Invoke(CurrentRoom); } } else { _transitionHandler.InvokeTransitionAction(CurrentRoom, room, RoomAfterTransitionAction); } return(true); }
private void RoomAfterTransitionAction() { CurrentRoom = _followingRoom; if (OnAfterRoomOpened != null) { OnAfterRoomOpened.Invoke(CurrentRoom); } }