You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MLAPI-Editor/MLAPIProfiler.cs
+26-2Lines changed: 26 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
usingMLAPI.Data.NetworkProfiler;
2
+
usingMLAPI.NetworkingManagerComponents.Binary;
2
3
usingSystem.Collections.Generic;
4
+
usingSystem.IO;
3
5
usingUnityEditor;
4
6
usingUnityEngine;
5
7
@@ -32,7 +34,7 @@ GUIStyle wrapStyle
32
34
floatlastDrawn=0;
33
35
structProfilerContainer
34
36
{
35
-
ProfilerTick[]ticks;
37
+
publicProfilerTick[]ticks;
36
38
}
37
39
privatevoidOnGUI()
38
40
{
@@ -46,16 +48,38 @@ private void OnGUI()
46
48
lastDrawn=0;
47
49
NetworkProfiler.Start(captureCount);
48
50
}
51
+
49
52
//Draw top bar
50
53
EditorGUILayout.BeginVertical();
51
54
EditorGUILayout.BeginHorizontal();
52
55
boolprevRec=record;
53
56
record=EditorGUILayout.Toggle("Record",record);
57
+
54
58
if(GUILayout.Button("Import datafile"))
55
59
{
56
-
stringpath=EditorUtility.OpenFilePanel("Choose a NetworkProfilerFile","","");
60
+
ProfilerTick[]ticks=BinarySerializer.Deserialize<ProfilerContainer>(File.ReadAllBytes(EditorUtility.OpenFilePanel("Choose a NetworkProfiler file","",""))).ticks;
0 commit comments