public void Update() { if (!gametimer.Running) { gametimertext.text = " "; } else { gametimertext.text = gametimer.SecondsLeft.ToString("0."); } //Player won or lose if (reqscore <= score && gametimer.Running) { win.SetActive(true); gameOver.Invoke(); Time.timeScale = 1; gametimer.Stop(); state = true; } else if (!gametimer.Running && !state) { lose.SetActive(true); gameOver.Invoke(); Time.timeScale = 1; gametimer.Stop(); } }
public void CheckLoss(WhiteBloodCell wbc) { if (player.GetComponent <PlayerTemp> ().currentWhiteBloodCellCount > 150000) { gameOverEvent.Invoke(false); } }
//Проверка команды private void CheckTeam(TeamController teamController) { if (teamController.IsCanContinue()) { GameOverEvent?.Invoke(this, new GameEventArgs($"{teamController.Team.Name} team - 5 players are injured")); } }
public static void GameOver() { if (GameOverEvent != null) { GameOverEvent.Invoke(); } }
public void GameOver() { gameActive = false; gameOverEvent.Invoke(); Time.timeScale = 0; StopAllCoroutines(); }
public void GameOver() { isGameOver = true; GameOverEvent?.Invoke(); Time.timeScale = 0f; }
public void LoseLife(int amount) { currentNumOfLives -= amount; onHealthChangeEvent.Invoke(currentNumOfLives, true); if (currentNumOfLives <= 0) { Debug.Log("Game Over"); onGameOverEvent.Invoke(true); StartCoroutine(OnGameOver()); } else { StartCoroutine(StartTauntAnimation()); } }
public void GameOver() { // TODO: Reset Timescale on reload. Time.timeScale = 0f; GameOverEvent?.Invoke(); }
public void InvokeGameOverEvent() { gameIsOver = true; if (GameOverEvent != null) { GameOverEvent.Invoke(); } }
private void OnGameOver() { Destroy(gameBall); if (GameOverEvent != null) { score = scoreCounter.score; GameOverEvent.Invoke(); } }
//what to do when the game is lost void GameOver() { //end the game IsGameActive = false; //Reveal The Word WordToGuess.Reveal(); // invoke the event only if someone listens to it (not Null) GameOverEvent?.Invoke(this, false); }
// health support void ReduceHealth(int damage) { Debug.Log("reduce health: " + damage.ToString()); health -= damage; if (health <= 0) { gameOverEvent.Invoke(); } }
private void GameOver() { Time.timeScale = 0; if (GameOverEvent != null) { GameOverEvent.Invoke(); } enabled = false; }
void OnLifeLost(int lifes) { if (lifes > 0) { return; } StopLevel(); GameOverEvent?.Invoke(false); }
public void OnGameOver() { Cursor.visible = true; StartCoroutine(Fade(Color.clear, new Color(0, 0, 0, 0.75f), 1)); gameOverScoreUI.text = scoreUI.text; scoreUI.gameObject.SetActive(false); healthBar.transform.parent.gameObject.SetActive(false); gameOverUI.SetActive(true); gameOverEvent.Invoke(); }
private void OnRunnerDied(BaseRunner runner) { Runners.Remove(runner); KillAllRunners -= runner.Die; if (Runners.Count < 1) { GetTree().Paused = true; Reset(); GameOverEvent?.Invoke(); } }
private void OnAlivePlayerUnitsChanged(int aliveUnitNo) { if (aliveUnitNo == 0) { if (onVictoryEvent != null) { onVictoryEvent.Invoke(); } _isGameRunning = false; playerWInEvent?.Invoke(); } }
private void OnAliveAIUnitsChanged(int aliveUnitNo) { if (aliveUnitNo == 0) { if (onDefeatEvent != null) { onDefeatEvent.Invoke(); } _isGameRunning = false; playerLoseEvent?.Invoke(); // } }
public void KillPlayer() { lives.value--; if (lives.value == 0) { coins.value = _coinsAtLevelStart; DWInput.userInputEnabled = false; GameOverEvent?.Invoke(); } else { SceneResetEvent?.Invoke(); } }
private void EnterGameState(GameState _state) { switch (_state) { case GameState.Shooting: ResetBallsShotData(); m_inputManager.InputShotEvent += OnPlayerShotInput; m_inputManager.InputMoveCameraEvent += OnMoveCameraInput; m_cameraManager.SmoothlyMoveToNewPositionWithAngle(0f); break; case GameState.ProcessingShot: break; case GameState.EndOfShotScoredPoint: ScoredPointEvent?.Invoke(); //checking if Game is over if (ScoreManager.Instance) { if (ScoreManager.Instance.CurrentGameScore >= m_gameOverScoreToReach) { SwitchGameState(GameState.GameOverScreen); } } else { Debug.LogError("Without a ScoreManager there will be no GameOver."); } break; case GameState.PreReplay: break; case GameState.ProcessingReplay: m_whiteBall.OnPlayerShot(m_lastShotData.shotPower, m_lastShotData.shotDirection); break; case GameState.GameOverScreen: GameOverEvent?.Invoke(); break; default: break; } EnterStateEvent?.Invoke(_state); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Pumpkin")) { rbKnife.velocity = Vector3.zero; transform.parent = collision.transform; stuck = true; Handheld.Vibrate(); } else if (collision.gameObject.CompareTag("Knife")) { if (collision.gameObject.GetComponent <Knife>().stuck) { rbKnife.velocity = Vector3.zero; transform.parent = null; rbKnife.gravityScale = 10; gameObject.transform.Rotate(0, 0, 12); knifeCol = true; GameOverEvent.Invoke(); Handheld.Vibrate(); } } else if (collision.gameObject.CompareTag("KnifeInPum")) { if (collision.gameObject.GetComponent <Knife>().stuck) { rbKnife.velocity = Vector3.zero; transform.parent = null; rbKnife.gravityScale = 10; gameObject.transform.Rotate(0, 0, 12); knifeCol = true; GameOverEvent?.Invoke(); Handheld.Vibrate(); } } }
public void Collide(Player player) //Check if the player collides with itself. { if (collidables[player.snakeBody.First().X, player.snakeBody.First().Y] != null) { if (collidables[player.snakeBody.First().X, player.snakeBody.First().Y] is Player) { player.Remove(this); Player playerFromMatrix = (Player)collidables[player.snakeBody.First().X, player.snakeBody.First().Y]; if (playerFromMatrix.playerID != player.playerID) { playerFromMatrix.Score += 5; } if (Players.Count < 1) { GameOverEvent.Invoke(player.playerID); } } } }
private void TimerCallback(object sender, Timers.ElapsedEventArgs e) { ++timeGone; if (timeGone == matchTime) { string result; if (HomeManager.Team.TeamScore == GuestManager.Team.TeamScore) { //Проверка на оставшееся дополнительное время if (additionalTime != 0) { --additionalTime; AdditionalTimeEvent(); return; } else { result = "Draw."; } } else { if (HomeManager.Team.TeamScore > GuestManager.Team.TeamScore) { result = "Home Team wins."; } else { result = "Guest Team wins"; } } GameOverEvent?.Invoke(this, new GameEventArgs($"Time left. {result}. Score <{HomeManager.Team.TeamScore} - {GuestManager.Team.TeamScore}>")); return; } }
public void GameOver() { _gameOverScreen.SetActive(true); Time.timeScale = 0; GameOverEvent?.Invoke(); }
public static void GameOver() { RevealAllMines(false); GameOverEvent.Invoke(); }
public void GameOverEventCall() { GameOverEvent?.Invoke(); }
public override void OnEnter() { base.OnEnter(); GameOverEvent.Invoke(); }
//wat to do when the game is won void WinGame() { IsGameActive = false; //invoke the event only if someone listens to it (not Null), pass true to indicate a win GameOverEvent?.Invoke(this, true); }
public void RequestGameOverEvent() { GameOverEvent?.Invoke(); }
public void DoITTT() { OnGameOver.Invoke(); }