/// <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(); }
protected override void OnDestroy() { if (Instance == this) { _Instance = null; Tock -= GameClock_Tock; } GameManager.Unpause -= GameManager_Unpause; GameManager.Pause -= GameManager_Pause; base.OnDestroy(); }
/// <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(); } }
protected override void Awake() { if (Instance != null) { Destroy(this); } else { _Instance = this; Tock += GameClock_Tock; } base.Awake(); }
/// <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(); }
/// <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; }
/// <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(); }
/// <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(); }
/// <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; }