private void Update() { if (hasGameStarted && !isPaused) { if (currentTime < 0) { currentTime = Levels[currentLevel].NewTaskCountdown; tm.SetNewTimeIntervalBetweenMinutes(Levels[currentLevel].IntervalBetweenEachMinute); Task temp = generateTask(Levels[currentLevel].NumberOfButtons); tm.AddTimedEvent(() => { //Debug.Log("Fired" + temp.Code); GameController.Instance.AddTasks(temp.Code, temp.TaskId); //Debug.Log("Fired timed event"); }, temp.Hour, temp.Minute); UIManager.Instance.AddUiTask(temp); if (debugMode) { hasGameStarted = false; } } else { currentTime -= Time.deltaTime; } } }