Example #1
0
        private void RenderElements(int Space, ProfilerElement Ele, double TotalTime)
        {
            if (Ele.IsValid())
            {
                var Percent = (Ele.GetTotalTime() / TotalTime);
                EditorGUILayout.BeginHorizontal();
                RenderSpace(Space);
                var Rect = GUILayoutUtility.GetRect(150, 20);
                EditorGUI.LabelField(Rect, $"{Ele.GetElementType()}");
                Rect = GUILayoutUtility.GetRect(400, 20);
                EditorGUI.ProgressBar(Rect, (float)Percent, $"{Percent * 100:0.00}%({Ele.GetTotalTime():0.000}s)");
                EditorGUILayout.EndHorizontal();

                var Childs = Ele.GetSortElements();
                if (Childs.Count > 0)
                {
                    foreach (var Child in Childs)
                    {
                        RenderElements(Space + 1, Child, Ele.GetTotalTime());
                    }
                }
            }
        }
Example #2
0
 public static void Clear()
 {
     Root_ = new ProfilerElement("Game", "Game");
 }