Пример #1
0
        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);
            }
        }
Пример #2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "Enemy")
     {
         isCatched = true;
         OnGameOverEvent?.Invoke();
     }
     if (collision.gameObject.tag == "Finish")
     {
         isCatched = true;
         OnWinEvent?.Invoke();
     }
 }
Пример #3
0
 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();
 }
Пример #5
0
 public void OnGameOver()
 {
     OnGameOverEvent?.Invoke(this, EventArgs.Empty);
 }
Пример #6
0
 private void OnGameOver(bool b = false)
 {
     OnGameOverEvent.Invoke(false);
     OnWaveOver(false);
 }
Пример #7
0
 /// <summary>
 /// Called when the character collide with itself or the matrix bounds.
 /// </summary>
 public void GameLost()
 {
     lostUI.SetActive(true);
     Time.timeScale = 0;
     OnGameOver.Invoke();
 }