public static void Notify(object sender, GameEventArgs e) { switch (e.type) { case START_GAME: StartGame?.Invoke(sender, e); break; case PAUSE_GAME: PauseGame?.Invoke(sender, e); break; case RESUME_GAME: ResumeGame?.Invoke(sender, e); break; case STOP_GAME: StopGame?.Invoke(sender, e); break; case RESTART_GAME: RestartGame?.Invoke(sender, e); break; case START_MINI_GAME: StartMiniGame?.Invoke(sender, e); break; case END_MINI_GAME: EndMiniGame?.Invoke(sender, e); break; } }
private void Update() { if (gameOver && Input.GetKeyDown(KeyCode.Return)) { RestartGame.RestartNow(); } }
/// <summary> /// Use it for notify from EventTrigger Component. Requires to be component on GameObject! /// </summary> /// <param name="sender">The sender object.</param> /// <param name="e">Event arguments</param> public void Notify(string type) { switch (type) { case START_GAME: StartGame?.Invoke(null, new GameEventArgs(type)); break; case PAUSE_GAME: PauseGame?.Invoke(null, new GameEventArgs(type)); break; case RESUME_GAME: ResumeGame?.Invoke(null, new GameEventArgs(type)); break; case STOP_GAME: StopGame?.Invoke(null, new GameEventArgs(type)); break; case RESTART_GAME: RestartGame?.Invoke(null, new GameEventArgs(type)); break; case START_MINI_GAME: StartMiniGame?.Invoke(null, new GameEventArgs(type)); break; case END_MINI_GAME: EndMiniGame?.Invoke(null, new GameEventArgs(type)); break; } }
public override void OnServerDisconnect(NetworkConnection conn) { base.OnServerDisconnect(conn); print(MethodBase.GetCurrentMethod().Name); RestartGame.RestartNow(); }
private void Update() { if (Input.GetKey(KeyCode.Space)) { RestartGame.RestartStatic(); } }
// Use this for initialization void Start() { appear = GetComponent <Appearance>(); motor = GetComponent <Motor>(); input = GetComponent <Inputs>(); restart = FindObjectOfType <RestartGame>(); }
/* * turn off timer * disable gameovertext * disable gameoverbutton * reset score to 0 */ //this method is on the RESTARTGAME button and restarts the game public void LetsRestartTheGameMethod() { RestartGame restartGame = Restart; if (restartGame != null) { //deactivate the gameover UI gameOverText.gameObject.SetActive(false); gameOverButton.gameObject.SetActive(false); saveHighScoreButton.gameObject.SetActive(false); inputfieldpanel.SetActive(false); //reset gametimer gameTimer = 0f; gameTimerText.text = "Time: "; //run the timer again isTimerRunning = true; //reset the score Score.instance.currentScore = 0; Score.instance.scoreText.text = "SCORE: "; //put lives back to 3 so the game can play lives = 3; livesLeft.text = "LIVES LEFT: " + lives; //fire the restart event Restart(); } }
private void RestartGame() { _logger.LogError($"Restarting game:\n{Environment.StackTrace}"); _window.RestartGame(); var restart = new RestartGame(this, _repository, _settings); restart.Run(CancellationToken.None).Wait(); }
private void OnTriggerEnter(Collider other) { if (other.tag == "bullet") { Debug.Log("Restart trigger restart ball hit"); RestartGame.DetachFloor(); Invoke("RestartScene", 3); } }
private void buttonGameAgaine_Click(object sender, RoutedEventArgs e) { textBlockLevelList[levelValue].Opacity = 0.75; textBlockLevelList[levelValue].Foreground = Brushes.White; imageLevelList[levelValue].Opacity = 0.65; textBlockResultAnswers.Text = ""; textBlockResultLevel.Text = ""; RestartGame?.Invoke(); }
// Use this for initialization void Start() { if (isLocalPlayer) { spawnPoints = FindObjectsOfType <NetworkStartPosition>(); } winLose = GameObject.FindObjectOfType <Text>(); winLose.text = ""; restart = Object.FindObjectOfType <RestartGame>(); }
public static void GameOver() { if (!IsGameOver) { IsGameOver = true; Debug.Log("Game over in Game Manager"); RestartGame.DetachFloor(); GameModeText.GameOver(); staticGameOver.Play(); //BallManager.ExplodeBalls(); //BallManager.ExplodeBalls(); //BallManager.ExplodeBalls(); } }
void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { if (Communicator.Player == null || Communicator.Player.isServer) { menu.SetActive(!menu.activeSelf); } } else if (Input.GetKeyDown(KeyCode.Return) && menu.activeSelf) { RestartGame.RestartNow(); } }
void PlayClick() { fader.Play("FadeOut(non-game)"); select.Play(); RestartGame.resetvalues(); }
private void OnRestartButtonClicked() { RestartGame?.Invoke(this, EventArgs.Empty); }
private void View_RestartButtonClicked(object sender, bool useBuffs) { RestartGame?.Invoke(this, useBuffs); }
public void Start() { UI = FindObjectOfType <UIManager>(); //tell unity how to find the UI gameobject restart = FindObjectOfType <RestartGame>(); }
private void Start() { _restartGame = FindObjectOfType <RestartGame>(); }
void Awake() { RG = this; }
public void OnRestart() { RestartGame?.Invoke(); }
void Awake() { instance = this; }
private void RestartScene() { RestartGame.RestartScene(); }
private void OnRestartGame() { RestartGame?.Invoke(); }