// Update is called once per frame void FixedUpdate() { if (started) { if (sceneState.IsObjectiveMet()) { UpdatedShelvedItems(); UpdatedUnloadedItems(); StopLevel(); } else { if (Input.GetKeyDown(KeyCode.Escape)) { StopLevel(); } else { UpdatedShelvedItems(); UpdatedUnloadedItems(); currentTime = DateTime.Now; TimeSpan ts = currentTime - startedTime; Text timer = (Text)timerObject.GetComponent <Text>(); if (timer != null) { UpdateTimerOrStopLevel(ts, timer); } else { Debug.Log("the timer came back null."); } } } } }