// public method to handle play vs ghost button behaviour public void GhostButtonHandler() { if (recordingsExist) { Recording recording = null; try{ recording = RecordingFileManager.TryReadRecording(recordings [currentRecordingIndex]); } catch (RecordingFormatException) { // something went wrong reading the recording DisplayMessage("Problem reading recording file."); } catch (PersistentStorageException) { DisplayMessage("Problem reading recording file."); } if (recording == null) { return; } // set up matchmaking for playagainst game, // and start matchmaking! MatchmakingMenuController.options = new MatchmakingMenuController.Options( UIState.RecordingsMenu, GameType.GHOST, recording.level, recording ); UIStateMachine.instance.GoTo(UIState.Matchmaking); } }
// public method to handle watch button behaviour public void WatchButtonHandler() { if (recordingsExist) { Recording recording = null; try{ recording = RecordingFileManager.TryReadRecording(recordings [currentRecordingIndex]); } catch (RecordingFormatException) { // something went wrong reading the recording DisplayMessage("Problem reading recording file."); } catch (PersistentStorageException) { DisplayMessage("Problem reading recording file."); } if (recording == null) { return; } SceneManager.StartReplayGame(recording.level, recording); } }