private void DrawTimers(GUIStyle styleStats) { bool isSimulating = SimulationManager.IsSimulating(); bool isReplaying = SimulationManager.IsReplaying(); bool isSimulatingOrReplaying = isSimulating || isReplaying; TimeSpan tRT; TimeSpan tSim; if (isSimulatingOrReplaying) { tRT = TimeSpan.FromSeconds( SimulationManager.GetSimulatingRealTime() ); tSim = TimeSpan.FromSeconds( SimulationManager.GetTimeSimulated() ); SceneView.RepaintAll(); } else { tRT = TimeSpan.FromSeconds( 0 ); tSim = TimeSpan.FromSeconds( 0 ); } string tRTString = string.Format("{0:D2}h:{1:D2}m:{2:D2}s:{3:D3}ms", tRT.Hours, tRT.Minutes, tRT.Seconds, tRT.Milliseconds); EditorGUILayout.LabelField("Real time: ", tRTString, styleStats); string tSimString = string.Format("{0:D2}h:{1:D2}m:{2:D2}s:{3:D3}ms", tSim.Hours, tSim.Minutes, tSim.Seconds, tSim.Milliseconds); EditorGUILayout.LabelField("Simulated time: ", tSimString, styleStats); }
//----------------------------------------------------------------------------------- private void ChangeToReplayingModeDone() { Int64 checksum = SimulationManager.CalculateChecksum(); CarDebug.Log(string.Format("Finished in {0:F3} secs. Checksum: " + Convert.ToString(checksum, 16), SimulationManager.GetSimulatingRealTime())); stopRequested_ = false; SimulationManager.ChangeToReplayingDone(); manager_.BuildBakerData(); manager_.BuildDisplayerVisibilityIntervals(); EditorApplication.update -= UpdateSimulating; EditorApplication.update += UpdateReplaying; SimulationManager.SetReplayingFrame((uint)frame_, true); playbackRangeMin_ = 0; playbackRangeMax_ = frame_; SceneView.RepaintAll(); CarManagerEditor.RepaintIfOpen(); }