private void OnDayComplete() { if (!gameData.hasTriggeredGameOver) { // food resourceController.CollectFoodProduce(); // wood gameData.woodIncrement = gameData.woodProduce; resourceController.AddWood(); // stone gameData.stoneIncrement = gameData.stoneProduce; resourceController.AddStone(); // potion gameData.potionIncrement = gameData.potionProduce; resourceController.AddPotion(); // booze gameData.boozeIncrement = gameData.boozeProduce; resourceController.AddBooze(); } else { OnGameOverEvent?.Invoke(gameData); } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Enemy") { isCatched = true; OnGameOverEvent?.Invoke(); } if (collision.gameObject.tag == "Finish") { isCatched = true; OnWinEvent?.Invoke(); } }
private void OnGameOver() { try { OnGameOverEvent?.Invoke(this, EventArgs.Empty); MessageBox.Show($"Game Over"); StartNewGame(); } catch (Exception ex) { throw; } }
/// <summary> /// Methode die vor dem ausführen des GameOverEvent prüft ob sich Methoden auf diese Events angemeldet haben. /// </summary> private void GameOverEventChain() { OnGameOverPreEvent?.Invoke(); OnGameOverEvent?.Invoke(); OnGameOverPostEvent?.Invoke(); }
public void OnGameOver() { OnGameOverEvent?.Invoke(this, EventArgs.Empty); }
private void OnGameOver(bool b = false) { OnGameOverEvent.Invoke(false); OnWaveOver(false); }
/// <summary> /// Called when the character collide with itself or the matrix bounds. /// </summary> public void GameLost() { lostUI.SetActive(true); Time.timeScale = 0; OnGameOver.Invoke(); }