Skip to content

Commit 580a58f

Browse files
Better Memory Tracking + Follow Transform Override + UX Improvements (#40)
1 parent 770ce14 commit 580a58f

File tree

5 files changed

+221
-25
lines changed

5 files changed

+221
-25
lines changed

VisualProfilerUnityProject/Assets/Scenes/SampleScene.unity

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,112 @@ MeshFilter:
334334
m_PrefabAsset: {fileID: 0}
335335
m_GameObject: {fileID: 335413767}
336336
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
337+
--- !u!1 &362975399
338+
GameObject:
339+
m_ObjectHideFlags: 0
340+
m_CorrespondingSourceObject: {fileID: 0}
341+
m_PrefabInstance: {fileID: 0}
342+
m_PrefabAsset: {fileID: 0}
343+
serializedVersion: 6
344+
m_Component:
345+
- component: {fileID: 362975401}
346+
- component: {fileID: 362975400}
347+
m_Layer: 0
348+
m_Name: VisualProfiler3DFollow
349+
m_TagString: Untagged
350+
m_Icon: {fileID: 0}
351+
m_NavMeshLayer: 0
352+
m_StaticEditorFlags: 0
353+
m_IsActive: 0
354+
--- !u!114 &362975400
355+
MonoBehaviour:
356+
m_ObjectHideFlags: 0
357+
m_CorrespondingSourceObject: {fileID: 0}
358+
m_PrefabInstance: {fileID: 0}
359+
m_PrefabAsset: {fileID: 0}
360+
m_GameObject: {fileID: 362975399}
361+
m_Enabled: 1
362+
m_EditorHideFlags: 0
363+
m_Script: {fileID: 11500000, guid: ee9fe1903f7351748999dead411e0a3b, type: 3}
364+
m_Name:
365+
m_EditorClassIdentifier:
366+
isVisible: 1
367+
frameSampleRate: 0.3
368+
defaultFrameRate: 60
369+
missedFramePercentage: 0.9
370+
displayedDecimalDigits: 1
371+
displayTriangleCount: 0
372+
batchesQualityLevelBudget:
373+
drawCallsQualityLevelBudget:
374+
meshStatsQualityLevelBudget:
375+
windowAnchor: 7
376+
windowOffset: {x: 0.1, y: 0.1}
377+
windowScale: 1
378+
windowFollowSpeed: 5
379+
snapWindow: 0
380+
alignToCamera: 1
381+
transformToFollow: {fileID: 1401076528}
382+
toggleKeyworlds:
383+
- Profiler
384+
- Toggle Profiler
385+
- Show Profiler
386+
- Hide Profiler
387+
layer: 0
388+
material: {fileID: 2100000, guid: b98f8349d37aef742baaa038e99837c0, type: 2}
389+
baseColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
390+
targetFrameRateColor: {r: 0.49803922, g: 0.7294118, b: 0, a: 1}
391+
missedFrameRateColor: {r: 0.9490196, g: 0.3137255, b: 0.13333334, a: 1}
392+
memoryUsedColor: {r: 0, g: 0.6431373, b: 0.9372549, a: 1}
393+
memoryPeakColor: {r: 1, g: 0.7254902, b: 0, a: 1}
394+
memoryLimitColor: {r: 0.39215687, g: 0.39215687, b: 0.39215687, a: 1}
395+
fontCharacterSize: {x: 16, y: 30}
396+
fontScale: {x: 0.00023, y: 0.00028}
397+
fontColumns: 32
398+
ProfilerDisplayOrder: 0
399+
ProfilerGroups:
400+
- DisplayName: Behaviour
401+
Markers:
402+
- StatName: BehaviourUpdate
403+
Operation: 0
404+
- StatName: LateBehaviourUpdate
405+
Operation: 0
406+
- StatName: FixedBehaviourUpdate
407+
Operation: 0
408+
SampleCapacity: 300
409+
BudgetPercentage: 1
410+
- DisplayName: Render
411+
Markers:
412+
- StatName: Inl_UniversalRenderTotal
413+
Operation: 0
414+
SampleCapacity: 300
415+
BudgetPercentage: 1
416+
- DisplayName: Physics
417+
Markers:
418+
- StatName: Physics.Processing
419+
Operation: 0
420+
- StatName: Physics.Simulate
421+
Operation: 0
422+
- StatName: Physics.FetchResults
423+
Operation: 0
424+
- StatName: Physics.UpdateBodies
425+
Operation: 0
426+
SampleCapacity: 300
427+
BudgetPercentage: 1
428+
--- !u!4 &362975401
429+
Transform:
430+
m_ObjectHideFlags: 0
431+
m_CorrespondingSourceObject: {fileID: 0}
432+
m_PrefabInstance: {fileID: 0}
433+
m_PrefabAsset: {fileID: 0}
434+
m_GameObject: {fileID: 362975399}
435+
serializedVersion: 2
436+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
437+
m_LocalPosition: {x: 0, y: 0, z: 0}
438+
m_LocalScale: {x: 1, y: 1, z: 1}
439+
m_ConstrainProportionsScale: 0
440+
m_Children: []
441+
m_Father: {fileID: 0}
442+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
337443
--- !u!1 &692745578
338444
GameObject:
339445
m_ObjectHideFlags: 0
@@ -727,6 +833,7 @@ Transform:
727833
- {fileID: 1473212392}
728834
- {fileID: 335413768}
729835
- {fileID: 716433997}
836+
- {fileID: 1401076528}
730837
m_Father: {fileID: 0}
731838
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
732839
--- !u!1 &963194225
@@ -926,6 +1033,7 @@ MonoBehaviour:
9261033
m_Name:
9271034
m_EditorClassIdentifier:
9281035
Profiler3D: {fileID: 1563446975}
1036+
Profiler3DFollow: {fileID: 362975399}
9291037
Profiler2D: {fileID: 1137945030}
9301038
Ball: {fileID: 9104521733164108909, guid: 3b471f76c2bfeac49b58ffb4f47b854d, type: 3}
9311039
BallSpawn: {fileID: 692745579}
@@ -961,6 +1069,7 @@ MonoBehaviour:
9611069
isVisible: 1
9621070
frameSampleRate: 0.3
9631071
defaultFrameRate: 60
1072+
missedFramePercentage: 0.9
9641073
displayedDecimalDigits: 1
9651074
displayTriangleCount: 0
9661075
batchesQualityLevelBudget:
@@ -972,6 +1081,7 @@ MonoBehaviour:
9721081
windowFollowSpeed: 5
9731082
snapWindow: 1
9741083
alignToCamera: 1
1084+
transformToFollow: {fileID: 0}
9751085
toggleKeyworlds:
9761086
- Profiler
9771087
- Toggle Profiler
@@ -1033,6 +1143,37 @@ Transform:
10331143
m_Children: []
10341144
m_Father: {fileID: 0}
10351145
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1146+
--- !u!1 &1401076527
1147+
GameObject:
1148+
m_ObjectHideFlags: 0
1149+
m_CorrespondingSourceObject: {fileID: 0}
1150+
m_PrefabInstance: {fileID: 0}
1151+
m_PrefabAsset: {fileID: 0}
1152+
serializedVersion: 6
1153+
m_Component:
1154+
- component: {fileID: 1401076528}
1155+
m_Layer: 0
1156+
m_Name: FollowTarget
1157+
m_TagString: Untagged
1158+
m_Icon: {fileID: 0}
1159+
m_NavMeshLayer: 0
1160+
m_StaticEditorFlags: 0
1161+
m_IsActive: 1
1162+
--- !u!4 &1401076528
1163+
Transform:
1164+
m_ObjectHideFlags: 0
1165+
m_CorrespondingSourceObject: {fileID: 0}
1166+
m_PrefabInstance: {fileID: 0}
1167+
m_PrefabAsset: {fileID: 0}
1168+
m_GameObject: {fileID: 1401076527}
1169+
serializedVersion: 2
1170+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
1171+
m_LocalPosition: {x: 0, y: 1, z: 1}
1172+
m_LocalScale: {x: 1, y: 1, z: 1}
1173+
m_ConstrainProportionsScale: 0
1174+
m_Children: []
1175+
m_Father: {fileID: 751500909}
1176+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
10361177
--- !u!1 &1473212391
10371178
GameObject:
10381179
m_ObjectHideFlags: 0
@@ -1170,6 +1311,7 @@ MonoBehaviour:
11701311
isVisible: 1
11711312
frameSampleRate: 0.3
11721313
defaultFrameRate: 60
1314+
missedFramePercentage: 0.9
11731315
displayedDecimalDigits: 1
11741316
displayTriangleCount: 0
11751317
batchesQualityLevelBudget:
@@ -1181,6 +1323,7 @@ MonoBehaviour:
11811323
windowFollowSpeed: 5
11821324
snapWindow: 0
11831325
alignToCamera: 0
1326+
transformToFollow: {fileID: 0}
11841327
toggleKeyworlds:
11851328
- Profiler
11861329
- Toggle Profiler
@@ -1482,6 +1625,7 @@ SceneRoots:
14821625
- {fileID: 963194228}
14831626
- {fileID: 705507995}
14841627
- {fileID: 1563446977}
1628+
- {fileID: 362975401}
14851629
- {fileID: 1137945032}
14861630
- {fileID: 276989807}
14871631
- {fileID: 751500909}

VisualProfilerUnityProject/Assets/Scripts/SampleControls.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,53 @@
22
// Licensed under the MIT License.
33

44
using System.Collections;
5-
using System.Collections.Generic;
65
using UnityEngine;
76

87
namespace Microsoft.MixedReality.Profiling.Sample
98
{
109
public class SampleControls : MonoBehaviour
1110
{
1211
public GameObject Profiler3D;
12+
public GameObject Profiler3DFollow;
1313
public GameObject Profiler2D;
1414

1515
public GameObject Ball;
1616
public Transform BallSpawn;
1717

1818
private int selectionIndex = 0;
19-
private string[] selectionStrings = { "Profiler 3D", "Profiler 2D" };
19+
private string[] selectionStrings = { "Profiler 3D", "Profiler 3D Follow", "Profiler 2D" };
2020

2121
private void OnGUI()
2222
{
23-
selectionIndex = GUI.SelectionGrid(new Rect(10, 10, 160, 20), selectionIndex, selectionStrings, 2);
23+
selectionIndex = GUI.SelectionGrid(new Rect(10, 10, 280, 40), selectionIndex, selectionStrings, 2);
2424

2525
switch (selectionIndex)
2626
{
2727
default:
2828
case 0:
2929
{
30-
Profiler2D.SetActive(false);
3130
Profiler3D.SetActive(true);
31+
Profiler3DFollow.SetActive(false);
32+
Profiler2D.SetActive(false);
3233
}
3334
break;
3435
case 1:
3536
{
3637
Profiler3D.SetActive(false);
38+
Profiler3DFollow.SetActive(true);
39+
Profiler2D.SetActive(false);
40+
}
41+
break;
42+
case 2:
43+
{
44+
Profiler3D.SetActive(false);
45+
Profiler3DFollow.SetActive(false);
3746
Profiler2D.SetActive(true);
3847
}
3948
break;
4049
}
4150

42-
if (GUI.Button(new Rect(10, 40, 80, 20), "Reset Balls"))
51+
if (GUI.Button(new Rect(10, 60, 80, 20), "Reset Balls"))
4352
{
4453
if (BallSpawn != null)
4554
{

VisualProfilerUnityProject/ProjectSettings/ProjectSettings.asset

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ PlayerSettings:
102102
xboxEnableFitness: 0
103103
visibleInBackground: 1
104104
allowFullscreenSwitch: 1
105-
fullscreenMode: 1
105+
fullscreenMode: 3
106106
xboxSpeechDB: 0
107107
xboxEnableHeadOrientation: 0
108108
xboxEnableGuest: 0
@@ -157,7 +157,8 @@ PlayerSettings:
157157
resetResolutionOnWindowResize: 0
158158
androidSupportedAspectRatio: 1
159159
androidMaxAspectRatio: 2.1
160-
applicationIdentifier: {}
160+
applicationIdentifier:
161+
Standalone: com.DefaultCompany.Visual-Profiler
161162
buildNumber:
162163
Standalone: 0
163164
VisionOS: 0

0 commit comments

Comments
 (0)