Ejemplo n.º 1
0
        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;
                }
            }

            EditorGUILayout.BeginVertical(GUI.skin.box);
            {
                EditorGUILayout.LabelField("Execution duration", EditorStyles.boldLabel);
                EditorGUILayout.LabelField("Total", systems.totalDuration.ToString());
                EditorGUILayout.Space();

                if (!EditorApplication.isPaused && !systems.paused)
                {
                    addDuration((float)systems.totalDuration);
                }
                _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f);
            }
            EditorGUILayout.EndVertical();
        }
        public override void OnInspectorGUI() {
			var debugSystemsBehaviour = (DebugSystemsBehaviour)target;
            var systems = debugSystemsBehaviour.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;
                }
            }

            EditorGUILayout.BeginVertical(GUI.skin.box);
            EditorGUILayout.LabelField(systems.name, EditorStyles.boldLabel);
            EditorGUILayout.LabelField("Initialize Systems", systems.initializeSystemsCount.ToString());
            EditorGUILayout.LabelField("Execute Systems", systems.executeSystemsCount.ToString());
            EditorGUILayout.LabelField("Total Systems", systems.totalSystemsCount.ToString());
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(GUI.skin.box);

            EditorGUILayout.BeginHorizontal();
            systems.paused = EditorGUILayout.Toggle("Step manually", systems.paused);
            EditorGUI.BeginDisabledGroup(!systems.paused);
            if (GUILayout.Button("Step", GUILayout.Width(100))) {
                systems.Step();
                addDuration((float)systems.totalDuration);
                _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f);
            }
            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField("Execution duration", EditorStyles.boldLabel);
            EditorGUILayout.LabelField("Total", systems.totalDuration.ToString());
            EditorGUILayout.Space();

            if (!EditorApplication.isPaused && !systems.paused) {
                addDuration((float)systems.totalDuration);
            }
            _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f);

            EditorGUILayout.BeginHorizontal();
            systems.avgResetInterval = (AvgResetInterval)EditorGUILayout.EnumPopup("Reset Ø", systems.avgResetInterval);
            if (GUILayout.Button("Reset Ø now", GUILayout.Width(88), GUILayout.Height(14))) {
                systems.Reset();
            }
            EditorGUILayout.EndHorizontal();

            systems.threshold = EditorGUILayout.Slider("Threshold", systems.threshold, 0f, 100f);
            EditorGUILayout.Space();

            drawSystemInfos(systems.systemInfos, false);

            EditorGUILayout.EndVertical();

            EditorUtility.SetDirty(target);
        }
Ejemplo n.º 3
0
        void drawSystemsMonitor(DebugSystems systems)
        {
            if (_systemsMonitor == null)
            {
                _systemsMonitor    = new SystemsMonitor(SYSTEM_MONITOR_DATA_LENGTH);
                _systemMonitorData = new Queue <float>(new float[SYSTEM_MONITOR_DATA_LENGTH]);
            }

            _showSystemsMonitor = EntitasEditorLayout.DrawSectionHeaderToggle("Performance", _showSystemsMonitor);
            if (_showSystemsMonitor)
            {
                EntitasEditorLayout.BeginSectionContent();
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.BeginVertical();
                        {
                            EditorGUILayout.LabelField("Execution duration", systems.executeDuration.ToString());
                            EditorGUILayout.LabelField("Cleanup duration", systems.cleanupDuration.ToString());
                        }
                        EditorGUILayout.EndVertical();

                        if (_stepButtonContent == null)
                        {
                            _stepButtonContent = EditorGUIUtility.IconContent("StepButton On");
                        }
                        if (_pauseButtonContent == null)
                        {
                            _pauseButtonContent = EditorGUIUtility.IconContent("PauseButton On");
                        }

                        systems.paused = GUILayout.Toggle(systems.paused, _pauseButtonContent, "CommandLeft");

                        if (GUILayout.Button(_stepButtonContent, "CommandRight"))
                        {
                            systems.paused = true;
                            systems.StepExecute();
                            systems.StepCleanup();
                            addDuration((float)systems.executeDuration + (float)systems.cleanupDuration);
                        }
                    }
                    EditorGUILayout.EndHorizontal();

                    if (!EditorApplication.isPaused && !systems.paused)
                    {
                        addDuration((float)systems.executeDuration + (float)systems.cleanupDuration);
                    }
                    _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f);
                }
                EntitasEditorLayout.EndSectionContent();
            }
        }
Ejemplo n.º 4
0
        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]);
                if (EditorApplication.update != Repaint) {
                    EditorApplication.update += Repaint;
                }
            }

            EditorGUILayout.BeginVertical(GUI.skin.box);
            {
                EditorGUILayout.LabelField("Execution duration", EditorStyles.boldLabel);
                EditorGUILayout.LabelField("Total", systems.totalDuration.ToString());
                EditorGUILayout.Space();

                if (!EditorApplication.isPaused && !systems.paused) {
                    addDuration((float)systems.totalDuration);
                }
                _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f);
            }
            EditorGUILayout.EndVertical();
        }
Ejemplo n.º 6
0
        public override void OnInspectorGUI()
        {
            var debugSystemsBehaviour = (DebugSystemsBehaviour)target;
            var systems = debugSystemsBehaviour.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;
                }
            }

            EditorGUILayout.BeginVertical(GUI.skin.box);
            EditorGUILayout.LabelField(systems.name, EditorStyles.boldLabel);
            EditorGUILayout.LabelField("Initialize Systems", systems.initializeSystemsCount.ToString());
            EditorGUILayout.LabelField("Execute Systems", systems.executeSystemsCount.ToString());
            EditorGUILayout.LabelField("Total Systems", systems.totalSystemsCount.ToString());
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(GUI.skin.box);

            EditorGUILayout.BeginHorizontal();
            systems.paused = EditorGUILayout.Toggle("Step manually", systems.paused);
            EditorGUI.BeginDisabledGroup(!systems.paused);
            if (GUILayout.Button("Step", GUILayout.Width(100)))
            {
                systems.Step();
                addDuration((float)systems.totalDuration);
                _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f);
            }
            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField("Execution duration", EditorStyles.boldLabel);
            EditorGUILayout.LabelField("Total", systems.totalDuration.ToString());
            EditorGUILayout.Space();

            if (!EditorApplication.isPaused && !systems.paused)
            {
                addDuration((float)systems.totalDuration);
            }
            _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f);

            EditorGUILayout.BeginHorizontal();
            systems.avgResetInterval = (AvgResetInterval)EditorGUILayout.EnumPopup("Reset Ø", systems.avgResetInterval);
            if (GUILayout.Button("Reset Ø now", GUILayout.Width(88), GUILayout.Height(14)))
            {
                systems.Reset();
            }
            EditorGUILayout.EndHorizontal();

            systems.threshold = EditorGUILayout.Slider("Threshold", systems.threshold, 0f, 100f);
            EditorGUILayout.Space();

            drawSystemInfos(systems.systemInfos, false);

            EditorGUILayout.EndVertical();

            EditorUtility.SetDirty(target);
        }
        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();
        }