浏览代码

- Updated FrameRate/Time debug view with using SmoothDT

- Workaround for destroyed GameObjects being accessed when leaving playmode.
/RenderPassXR_Sandbox
Julien Ignace 8 年前
当前提交
6b2abb76
共有 2 个文件被更改,包括 9 次插入2 次删除
  1. 7
      Assets/ScriptableRenderPipeline/Core/Debugging/DebugPanelUI.cs
  2. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs

7
Assets/ScriptableRenderPipeline/Core/Debugging/DebugPanelUI.cs


public void Update()
{
// A bit dirty... this will happen when we exit playmode.
// The problem happens when the persistent menu is not empty and we leave playmode.
// In this case, the gameObjects will be destroyed but not the ItemUIs (because we can't know when we exit playmode)
// To avoid accessing destroyed GameObjects we test the root...
if (m_Root == null)
return;
foreach (var itemUI in m_ItemsUI)
{
if (itemUI.dynamicDisplay)

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs


public void RegisterDebug()
{
DebugMenuManager.instance.AddDebugItem<float>("Display Stats", "Frame Rate", () => 1.0f / Time.deltaTime, null, true);
DebugMenuManager.instance.AddDebugItem<float>("Display Stats", "Frame Time", () => Time.deltaTime * 1000.0f, null, true);
DebugMenuManager.instance.AddDebugItem<float>("Display Stats", "Frame Rate", () => 1.0f / Time.smoothDeltaTime, null, true);
DebugMenuManager.instance.AddDebugItem<float>("Display Stats", "Frame Time (ms)", () => Time.smoothDeltaTime * 1000.0f, null, true);
DebugMenuManager.instance.AddDebugItem<int>("Material", "Material",() => materialDebugSettings.debugViewMaterial, (value) => SetDebugViewMaterial((int)value), false, new DebugItemHandlerIntEnum(DebugDisplaySettings.debugViewMaterialStrings, DebugDisplaySettings.debugViewMaterialValues));
DebugMenuManager.instance.AddDebugItem<int>("Material", "Engine",() => materialDebugSettings.debugViewEngine, (value) => SetDebugViewEngine((int)value), false, new DebugItemHandlerIntEnum(DebugDisplaySettings.debugViewEngineStrings, DebugDisplaySettings.debugViewEngineValues));

正在加载...
取消
保存