private void Update() { if (timerStarted) { if (!gameData.gameIsPaused) { gameData.dayCountdownSeconds += Time.deltaTime * gameData.gameSpeed; float nightTime = Mathf.Floor(gameData.dayCountdownSeconds); if (nightTime == gameData.daySpeedInSeconds * 0.5f && !hasTriggeredNightStart) { hasTriggeredNightStart = true; OnDayComplete?.Invoke(); } if (gameData.dayCountdownSeconds >= gameData.daySpeedInSeconds) { gameData.dayCountdownSeconds = 0; hasTriggeredNightStart = false; OnDayStarted?.Invoke(); } } } }
void DayTicks() { OnDayComplete?.Invoke(); DayCounter += 1; GameManager.instance.UI.UpdateDayTimeUI(); }