StepCleanup() public method

public StepCleanup ( ) : void
return void
Example #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]);
            }

            _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();
            }
        }
        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("Execution duration", systems.executeDuration.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.StepExecute();
                        systems.StepCleanup();
                        addDuration((float)systems.executeDuration);
                    }
                }
                EntitasEditorLayout.EndHorizontal();

                if (!EditorApplication.isPaused && !systems.paused)
                {
                    addDuration((float)systems.executeDuration);
                }
                _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("Execution duration", systems.executeDuration.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.StepExecute();
                        systems.StepCleanup();
                        addDuration((float)systems.executeDuration);
                    }
                }
                EntitasEditorLayout.EndHorizontal();

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