Skip to content

Commit bc8dac2

Browse files
committed
UniLoop
1 parent e0cec85 commit bc8dac2

File tree

143 files changed

+4853
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+4853
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/[Bb]uilds/
1111
/[Ll]ogs/
1212
/[Uu]ser[Ss]ettings/
13+
/[Pp]rofiler[Cc]aptures/
1314
*.log
1415

1516
# By default unity supports Blender asset imports, *.blend1 blender files do not need to be commited to version control.

.vsconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "1.0",
3+
"components": [
4+
"Microsoft.VisualStudio.Workload.ManagedGame"
5+
]
6+
}

Assets/PlayerLoop.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/PlayerLoop/Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "UniLoop.Editor",
3+
"rootNamespace": "",
4+
"references": [
5+
"GUID:e1a74f04720880a4886fae4631240f92"
6+
],
7+
"includePlatforms": [],
8+
"excludePlatforms": [],
9+
"allowUnsafeCode": false,
10+
"overrideReferences": false,
11+
"precompiledReferences": [],
12+
"autoReferenced": true,
13+
"defineConstraints": [],
14+
"versionDefines": [],
15+
"noEngineReferences": false
16+
}

Assets/PlayerLoop/Editor/NewAssembly.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
using CatCode.PlayerLoops;
2+
using UnityEditor;
3+
using UnityEngine;
4+
5+
public class UniLoopWindow : EditorWindow
6+
{
7+
private Vector2 _scroll;
8+
9+
[MenuItem("Window/UniLoop Tracker")]
10+
public static void Open() => GetWindow<UniLoopWindow>("Loop Runner Debugger");
11+
12+
private void Update() => Repaint();
13+
14+
private void OnGUI()
15+
{
16+
if (!EditorApplication.isPlaying)
17+
{
18+
EditorGUILayout.HelpBox("Loop Runner Debugger доступен только в Play Mode.", MessageType.Info);
19+
return;
20+
}
21+
22+
var snapshots = UniLoop.GetSnapshot();
23+
_scroll = EditorGUILayout.BeginScrollView(_scroll);
24+
DrawGlobalHeader();
25+
if (snapshots != null && snapshots.Length > 0)
26+
for (int i = 0; i < snapshots.Length; i++)
27+
DrawRunnerBlock(snapshots[i]);
28+
else
29+
GUILayout.Label("No snapshot data available.");
30+
EditorGUILayout.EndScrollView();
31+
}
32+
33+
private void DrawGlobalHeader()
34+
{
35+
GUILayout.Space(6);
36+
EditorGUILayout.LabelField("Loop Runner Snapshot", EditorStyles.boldLabel);
37+
GUILayout.Space(4);
38+
}
39+
40+
private void DrawRunnerBlock(TimingRunnerSnapshot runner)
41+
{
42+
// Position header
43+
GUILayout.Space(6);
44+
EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
45+
EditorGUILayout.LabelField($"Timing: {runner.Position.Timing}", GUILayout.Width(140));
46+
EditorGUILayout.LabelField($"Phase: {runner.Position.Phase}", GUILayout.Width(100));
47+
EditorGUILayout.EndHorizontal();
48+
49+
// Columns header for processors
50+
EditorGUILayout.BeginHorizontal();
51+
DrawCol("Type", 180);
52+
DrawCol("Total", 60);
53+
DrawCol("Active", 60);
54+
DrawCol("Pending", 60);
55+
EditorGUILayout.EndHorizontal();
56+
57+
// Processor rows
58+
var processors = runner.RunnerSnapshots;
59+
for (int p = 0; p < processors.Length; p++)
60+
{
61+
var ps = processors[p];
62+
EditorGUILayout.BeginHorizontal();
63+
DrawCol(ps.Type.ToString(), 180);
64+
DrawCol(ps.Metrics.TotalCount.ToString(), 60);
65+
DrawCol(ps.Metrics.Count.ToString(), 60);
66+
DrawCol(ps.Metrics.PendingAddCount.ToString(), 60);
67+
EditorGUILayout.EndHorizontal();
68+
}
69+
70+
GUILayout.Space(4);
71+
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
72+
}
73+
74+
private void DrawCol(string text, float width)
75+
{
76+
GUILayout.Label(text, GUILayout.Width(width));
77+
}
78+
}

Assets/PlayerLoop/Editor/UniLoopWindow.cs.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/PlayerLoop/Runtime.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/PlayerLoop/Runtime/Collections.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)