Ejemplo n.º 1
0
        /// <summary>
        /// Called by the Game Clock when a new day begins.
        /// </summary>
        /// <param name="clock"></param>
        private void GameClock_DayStart(GameClock clock)
        {
            // Did the seasons change?  If so, we need to recalculate weather ranges
            if (isNewSeason)
            {
                isNewSeason = false;
                ResetWeather();
            }

            // Calculate the weather for today.
            CalculateWeather();
        }
Ejemplo n.º 2
0
        protected override void OnDestroy()
        {
            if (Instance == this)
            {
                _Instance = null;
                Tock     -= GameClock_Tock;
            }

            GameManager.Unpause -= GameManager_Unpause;
            GameManager.Pause   -= GameManager_Pause;

            base.OnDestroy();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Called by the game clock when a new hour strikes.
        /// </summary>
        /// <param name="clock">The current game clock instance.</param>
        private void GameClock_NewHour(GameClock clock)
        {
            if (currentDaySheet == null)
            {
                return;
            }

            currentHour++;

            if (currentHour < currentDaySheet.Length)
            {
                UpdateImage();
            }
        }
Ejemplo n.º 4
0
        protected override void Awake()
        {
            if (Instance != null)
            {
                Destroy(this);
            }
            else
            {
                _Instance = this;
                Tock     += GameClock_Tock;
            }

            base.Awake();
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Called by GameClock when the game day ends and is used to hide the game panel
 /// </summary>
 /// <param name="clock"></param>
 private void GameClock_GameDayEnd(GameClock clock)
 {
     PauseGame();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Called by Game Clock when the game day ends.
 /// </summary>
 /// <param name="clock">The current game clock instance.</param>
 private void GameClock_GameDayEnd(GameClock clock)
 {
     hasUpdatedWeather = false;
     currentHour       = 0;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Called by the Game Clock when a game day ends.  This event will make the
 /// UI Manager hide the game panel and spawn the end of day summary panel.
 /// </summary>
 /// <param name="clock"></param>
 private void GameClock_GameDayEnd(GameClock clock)
 {
     HideGamePanel();
     ShowEndOfDaySummary();
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Called by this class when we are updating the game time.
 /// </summary>
 /// <param name="clock">The current game clock instance.</param>
 private void GameClock_Tock(GameClock clock)
 {
     UpdateTime();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Called by the Game Clock when the season changes.
 /// </summary>
 /// <param name="clock"></param>
 private void GameClock_NewSeason(GameClock clock)
 {
     // Toggle the new season flag
     isNewSeason = true;
 }