Exemple #1
0
 protected override void handleGameTogglePause(bool isPaused)
 {
     base.handleGameTogglePause(isPaused);
     if (IsScouting)
     {
         if (isPaused)
         {
             this.timePaused = DateTime.Now;
         }
         else
         {
             if (hasTimePaused())
             {
                 double secondsPassed = (DateTime.Now - timePaused).TotalSeconds;
                 Info.UpdateTimePassed((float)secondsPassed);
                 scoutingTimer.SetTimeRemaining(Info.TimeRemainingScouting, checkForEvents: false);
                 timePaused = default(DateTime);
             }
         }
     }
 }
Exemple #2
0
 protected override void fetchReferences()
 {
     base.fetchReferences();
     if (feedingTimer == null)
     {
         feedingTimer = new PPTimer(GetFeedingTime, 1f);
         feedingTimer.SetTimeRemaining(0, false);
     }
     feedingTimer.SubscribeToTimeBegin(handleFeedingTimeBegin);
     feedingTimer.SubscribeToTimeUp(handleFeedingTimeUp);
     buttonReference = GetComponent <Button>();
     buttonReference.interactable = !IsCurrentlyFeeding;
     foodSelector.Setup(dataController.AllFood, feedDogs);
 }
Exemple #3
0
 protected override void handleGameTogglePause(bool isPaused)
 {
     base.handleGameTogglePause(isPaused);
     if (isPaused)
     {
         this.timePaused = DateTime.Now;
     }
     else
     {
         if (dailyGiftTimer != null && dailyGiftTimer.IsRunning && hasTimePaused())
         {
             double secondsPassed        = (DateTime.Now - this.timePaused).TotalSeconds;
             float  updatedTimeRemaining = dailyGiftTimer.TimeRemaining - (float)secondsPassed;
             dailyGiftTimer.SetTimeRemaining(updatedTimeRemaining, checkForEvents: false);
             this.timePaused = default(DateTime);
         }
     }
 }