private void OpenClose() { // pre open time if (_timeLink.GetCurrentTime() == preOpeningHour && !preOpenBool) { _timeLink.StopTimer(); _timeLink.StartTimer(); preOpenBool = true; // create UI stuff to show next day } //open time else if (_timeLink.FCurrentHour == openingHour && !openOnce) { arcadeStatus = ArcadeOpeningStatus.Open; mainDoors.OpenDoor(); openOnce = true; preOpenBool = false; closedOnce = false; doorAnimBool = true; } //close time else if (_timeLink.FCurrentHour == closingHour && !closedOnce) { if (_economyLink.Bankrupt == true) { _timeLink.StopTimer(); _economyLink.bankruptcyUI.SetActive(true); _economyLink.bankruptcyUI.GetComponent <BankruptcyUIController>().Bankrupt(); } customerManager.MassLeave(); arcadeStatus = ArcadeOpeningStatus.Closed; // enable UI element to show data of the day closedOnce = true; openOnce = false; _economyLink.ClosingTime(); } }
// Update is called once per frame void Update() { if (currentCash <= 0 && !Bankrupt) { bankruptcyUI.SetActive(true); bankruptcyUI.GetComponent <BankruptcyUIController>().Warning(); print("Bankrupt"); _timeAndCalendarLink.StopTimer(); Bankrupt = true; } else if (currentCash > 0) { Bankrupt = false; } if (currentCash % 1 != 0) { currentCash = Mathf.RoundToInt(currentCash); } }
public void pauseTimer() { timeAndCalendarLink.StopTimer(); }