private void ResetDay() { currentDay = TimeHandler.currentDay; currentFrame = 0; currentTime = 0.0f; currentMemTotal = 0.0f; minimumFPS = Mathf.Infinity; maximumFPS = 0.0f; maximumMemory = 0.0f; minimumMemory = Mathf.Infinity; TimeHandler.PauseGame(); }
// Update is called once per frame void Update() { if (Input.GetButtonDown("Pause")) { TimeHandler.PauseGame(); } if (Input.GetButtonDown("ChangeSpeedUp")) { TimeHandler.ChangeTimeScale(timeScaleChangeIncrement); } else if (Input.GetButtonDown("ChangeSpeedDown")) { TimeHandler.ChangeTimeScale(-timeScaleChangeIncrement); } }
void Update() { if (timeAnalysis) { if (!TimeHandler.gamePaused && !firstUpdate) { if (endOfDay) { ResetDay(); } if (currentDay != TimeHandler.currentDay) { for (int i = 0; i < 14; i++) { if (SpawnBaseTypes.classNumbers[i] > 0) { sleepTimeShow[i] = sleepTimeShow[i] / SpawnBaseTypes.classNumbers[i]; restTimeShow[i] = restTimeShow[i] / SpawnBaseTypes.classNumbers[i]; workTimeShow[i] = workTimeShow[i] / SpawnBaseTypes.classNumbers[i]; recreationTimeShow[i] = recreationTimeShow[i] / SpawnBaseTypes.classNumbers[i]; socialTimeShow[i] = socialTimeShow[i] / SpawnBaseTypes.classNumbers[i]; travelTimeShow[i] = travelTimeShow[i] / SpawnBaseTypes.classNumbers[i]; } } endOfDay = true; TimeHandler.PauseGame(); return; } sleepTimeShow = sleepTime; restTimeShow = restTime; workTimeShow = workTime; recreationTimeShow = recreationTime; socialTimeShow = socialTime; travelTimeShow = travelTime; } if (firstUpdate) { firstUpdate = false; } } }
void Update() { if (spatialAnalysis) { if (!TimeHandler.gamePaused && !firstUpdate) { if (endOfDay) { ResetDay(); } if (currentHour != TimeHandler.currentHour) { NewHour(); } if (currentDay != TimeHandler.currentDay) { endOfDay = true; TimeHandler.PauseGame(); return; } } if (firstUpdate) { firstUpdate = false; hourSpaceGraphSleep = new int[24]; hourSpaceGraphRest = new int[24]; hourSpaceGraphWork = new int[24]; hourSpaceGraphRecreation = new int[24]; hourSpaceGraphSocial = new int[24]; hourSpaceGraphTravel = new int[24]; agentsTravel = 0; } } }