Пример #1
0
        private int DrawSystemInfos(AntDebugScenario aScenario, bool aInitOnly, bool aIsChildSystem)
        {
            var systemInfosList = (aInitOnly)
                                ? aScenario.InitializeSystemsInfos
                                : aScenario.ExecuteSystemInfos;

            var systemInfos = systemInfosList
                              .Where(sys => sys.AverageExecutionDuration >= _threshold)
                              .ToArray();

            systemInfos = SortSystemInfos(systemInfos, _systemSortMode);

            int count = 0;
            AntDebugScenario debugScenario;
            AntSystemInfo    systemInfo;

            for (int i = 0, n = systemInfos.Length; i < n; i++)
            {
                systemInfo    = systemInfos[i];
                debugScenario = systemInfo.System as AntDebugScenario;

                /*if (debugScenario != null)
                 * {
                 *      if (aInitOnly && debugScenario.InitializeSystemsCount == 0)
                 *      {
                 *              continue;
                 *      }
                 * }*/

                if (systemInfo.Name.ToLower().Contains(_systemNameSearchTerm.ToLower()))
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUI.BeginDisabledGroup(aIsChildSystem);
                        {
                            systemInfo.isActive = EditorGUILayout.Toggle(systemInfo.isActive, GUILayout.Width(20.0f));
                        }
                        EditorGUI.EndDisabledGroup();

                        var avg = string.Format("- {0:00.000}", systemInfo.AverageExecutionDuration).PadRight(12);
                        var min = string.Format("▼ {0:00.000}", systemInfo.MinExecutionDuration).PadRight(12);
                        var max = string.Format("▲ {0:00.000}", systemInfo.MaxExecutionDuration);

                        EditorGUILayout.LabelField(systemInfo.Name, avg + min + max);
                    }
                    EditorGUILayout.EndHorizontal();
                }

                if (debugScenario != null)
                {
                    EditorGUI.indentLevel++;
                    count += DrawSystemInfos(debugScenario, aInitOnly, true);
                    EditorGUI.indentLevel--;
                }

                count++;
            }

            return(count);
        }
Пример #2
0
 public void Init(AntDebugScenario aScenario)
 {
     Scenario = aScenario;
 }