Custom Update Order (#39)
This commit is contained in:
Родитель
07fe0453ce
Коммит
770ce149ec
|
@ -0,0 +1,2 @@
|
|||
# Visual Studio cache directory
|
||||
.vs/
|
|
@ -69,7 +69,7 @@ Custom profilers can be added to the bottom of the Visual Profiler by adding to
|
|||
|
||||
## Sample
|
||||
|
||||
A sample Unity project can be found in the *VisualProfilerUnityProject* folder. This project contains a simple sample scene that demonstrates the visual profiler being used in 3D and 2D (perspective and orthographic cameras) plus example profiler groups for C# behaviors, rendering, and physics.
|
||||
A sample Unity project can be found in the *VisualProfilerUnityProject* folder. This project contains a simple sample scene that demonstrates the Visual Profiler being used in 3D and 2D (perspective and orthographic cameras) plus example profiler groups for C# behaviors, rendering, and physics.
|
||||
|
||||
![Sample](README/Images/Sample.png)
|
||||
|
||||
|
|
|
@ -602,6 +602,7 @@ namespace Microsoft.MixedReality.Profiling
|
|||
private bool instanceColorsDirty = false;
|
||||
private bool instanceBaseColorsDirty = false;
|
||||
private bool instanceUVOffsetScaleXDirty = false;
|
||||
private bool customUpdateInUse = false;
|
||||
|
||||
/// <summary>
|
||||
/// Reset any stats the profiler is tracking. Call this if you would like to restart tracking
|
||||
|
@ -622,6 +623,19 @@ namespace Microsoft.MixedReality.Profiling
|
|||
limitMemoryUsage = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows for an app to specific a custom point in the frame to call update. (Should be called once every frame.)
|
||||
/// </summary>
|
||||
public void CustomUpdate()
|
||||
{
|
||||
customUpdateInUse = true;
|
||||
|
||||
if (isActiveAndEnabled)
|
||||
{
|
||||
InternalUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (material == null)
|
||||
|
@ -725,6 +739,14 @@ namespace Microsoft.MixedReality.Profiling
|
|||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (customUpdateInUse == false)
|
||||
{
|
||||
InternalUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
private void InternalUpdate()
|
||||
{
|
||||
#if ENABLE_PROFILER
|
||||
foreach (var profilerGroup in ProfilerGroups)
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ MonoImporter:
|
|||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- material: {fileID: 2100000, guid: b98f8349d37aef742baaa038e99837c0, type: 2}
|
||||
executionOrder: 1000
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "com.microsoft.mixedreality.visualprofiler",
|
||||
"version": "3.6.0",
|
||||
"version": "3.7.0",
|
||||
"displayName": "Microsoft Mixed Reality Visual Profiler",
|
||||
"description": "Provides a drop in solution for viewing your mixed reality Unity application's frame rate, scene complexity, and memory usage.",
|
||||
"documentationUrl": "https://github.com/microsoft/VisualProfiler-Unity/blob/main/README.md",
|
||||
|
|
Загрузка…
Ссылка в новой задаче