Skip to content

Commit 6290f29

Browse files
committed
Add Profiler markers
1 parent 1d66740 commit 6290f29

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Editor/TriPropertyTree.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using TriInspector.Elements;
33
using UnityEditor;
44
using UnityEngine;
5+
using UnityEngine.Profiling;
56

67
namespace TriInspector
78
{
@@ -46,15 +47,17 @@ public void RunValidationIfRequired()
4647
{
4748
return;
4849
}
49-
50+
5051
RunValidation();
5152
}
5253

5354
public void RunValidation()
5455
{
5556
ValidationRequired = false;
5657

58+
Profiler.BeginSample("TriInspector.RunValidation");
5759
RootProperty.RunValidation();
60+
Profiler.EndSample();
5861

5962
RequestRepaint();
6063
}
@@ -72,7 +75,9 @@ public virtual void Draw()
7275
_rootPropertyElement.AttachInternal();
7376
}
7477

78+
Profiler.BeginSample("TriInspector.UpdateRootPropertyElement");
7579
_rootPropertyElement.Update();
80+
Profiler.EndSample();
7681

7782
var rectOuter = GUILayoutUtility.GetRect(0, 9999, 0, 0);
7883
_cachedOuterRect = Event.current.type == EventType.Layout ? _cachedOuterRect : rectOuter;
@@ -86,7 +91,9 @@ public virtual void Draw()
8691

8792
GUILayoutUtility.GetRect(_cachedOuterRect.width, rect.height);
8893

94+
Profiler.BeginSample("TriInspector.DrawRootPropertyElement");
8995
_rootPropertyElement.OnGUI(rect);
96+
Profiler.EndSample();
9097

9198
EditorGUI.indentLevel = oldIndent;
9299
}

0 commit comments

Comments
 (0)