public void QuitButtonHandler() { print("QUIT"); GameQuit?.Invoke(); InterfaceController.Instance.Hide(GameWindow.PauseMenu); LocalisationController.Instance.PlayAudioClip(Settings.Autogenerated.SoundSettingsKey.PopupSound); SceneActivationBehaviour <MainMenuActivator> .Instance.QuitButtonHandler(); }
public void QuitGameButtonHandler() { InterfaceController.Instance.Show(GameWindow.CollectionScreen); InterfaceController.Instance.Hide(GameWindow.BoardBlur); InterfaceController.Instance.Hide(GameWindow.BoardMenu); InterfaceController.Instance.Hide(GameWindow.BoardUI); InterfaceController.Instance.Hide(GameWindow.BonusBarUI); InterfaceController.Instance.Hide(GameWindow.ToolbarUI); InterfaceController.Instance.Hide(GameWindow.TopBarUI); InterfaceController.Instance.Hide(GameWindow.PostGameScene); GameQuit?.Invoke(); }
public async Task FindGame() { try { if (_connection != null) { await _connection.DisposeAsync(); } _connection = new HubConnectionBuilder() .WithUrl("http://rps-server.azurewebsites.net/gamehub") .Build(); _connection.On <string>("ReceiveMessage", (message) => { Console.WriteLine(message); }); _connection.On <string>("StartGame", (gameId) => { Console.WriteLine(gameId); GameFound?.Invoke(gameId); }); _connection.On <GameResult>("GameResult", (result) => { GameResult?.Invoke(result); }); _connection.On <string>("QuitGame", async(message) => { GameQuit?.Invoke(message); }); await _connection.StartAsync(); Console.WriteLine("Started!"); } catch (Exception ex) { Console.WriteLine(ex); } }