void drawStepper(DebugSystems systems) { EditorGUILayout.BeginVertical(GUI.skin.box); { EditorGUILayout.LabelField("Step Mode", EditorStyles.boldLabel); EditorGUILayout.BeginHorizontal(); { var buttonStyle = new GUIStyle(GUI.skin.button); if (systems.paused) { buttonStyle.normal = GUI.skin.button.active; } if (GUILayout.Button("▌▌", buttonStyle, GUILayout.Width(50))) { systems.paused = !systems.paused; } if (GUILayout.Button("Step", GUILayout.Width(100))) { systems.paused = true; systems.Step(); addDuration((float)systems.totalDuration); _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f); } GUILayout.FlexibleSpace(); } EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); }
void drawSystemsMonitor(DebugSystems systems) { if (_systemsMonitor == null) { _systemsMonitor = new SystemsMonitor(SYSTEM_MONITOR_DATA_LENGTH); _systemMonitorData = new Queue <float>(new float[SYSTEM_MONITOR_DATA_LENGTH]); if (EditorApplication.update != Repaint) { EditorApplication.update += Repaint; } } EntitasEditorLayout.BeginVerticalBox(); { EditorGUILayout.LabelField("Execution duration", EditorStyles.boldLabel); EntitasEditorLayout.BeginHorizontal(); { EditorGUILayout.LabelField("Total", systems.totalDuration.ToString()); var buttonStyle = new GUIStyle(GUI.skin.button); if (systems.paused) { buttonStyle.normal = GUI.skin.button.active; } if (GUILayout.Button("▌▌", buttonStyle, GUILayout.Width(50))) { systems.paused = !systems.paused; } if (GUILayout.Button("Step", GUILayout.Width(50))) { systems.paused = true; systems.Step(); addDuration((float)systems.totalDuration); _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f); } } EntitasEditorLayout.EndHorizontal(); if (!EditorApplication.isPaused && !systems.paused) { addDuration((float)systems.totalDuration); } _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f); } EntitasEditorLayout.EndVertical(); }
void drawSystemsMonitor(DebugSystems systems) { if (_systemsMonitor == null) { _systemsMonitor = new SystemsMonitor(SYSTEM_MONITOR_DATA_LENGTH); _systemMonitorData = new Queue<float>(new float[SYSTEM_MONITOR_DATA_LENGTH]); } EntitasEditorLayout.BeginVerticalBox(); { EditorGUILayout.LabelField("Execution duration", EditorStyles.boldLabel); EntitasEditorLayout.BeginHorizontal(); { EditorGUILayout.LabelField("Total", systems.totalDuration.ToString()); var buttonStyle = new GUIStyle(GUI.skin.button); if (systems.paused) { buttonStyle.normal = GUI.skin.button.active; } if (GUILayout.Button("▌▌", buttonStyle, GUILayout.Width(50))) { systems.paused = !systems.paused; } if (GUILayout.Button("Step", GUILayout.Width(50))) { systems.paused = true; systems.Step(); addDuration((float)systems.totalDuration); _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f); } } EntitasEditorLayout.EndHorizontal(); if (!EditorApplication.isPaused && !systems.paused) { addDuration((float)systems.totalDuration); } _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f); } EntitasEditorLayout.EndVertical(); }