Exemplo n.º 1
0
 void HandleOptionSelected(Answer selectedOption)
 {
     if (DateTime.Now - _lastClick > new TimeSpan(0, 0, 0, 0, 500))
     {
         Debug.Log("Selected option " + selectedOption.Name);
         Debug.Log("Closer to doom by " + selectedOption.Doom + "Current doom:" + _clock.GetValue());
         dialogBox.SetActive(false);
         _questionPanel.SetActive(false);
         _clock.SetValueOffset(selectedOption.Doom);
         if (_clock.GetValue() >= 12f)
         {
             gameEndController.Lose();
             return;
         }
         if (game.dayNumber >= 7)
         {
             gameEndController.Win();
             return;
         }
         _skyController.NextDay(_clock.GetRelativeValue());
         _newspaperController.OpenDelayed(Game.instance.newspaperOpenDelay, (selectedOption.News != null ? selectedOption.News : "No news is good news"));
         _lastClick      = DateTime.Now;
         game.dayNumber += 1;
     }
 }