Unity-NorthStar / data /Packages /com.unity.render-pipelines.universal /Runtime /Debug /DebugDisplaySettingsCommon.cs
| namespace UnityEngine.Rendering.Universal | |
| { | |
| class DebugDisplaySettingsCommon : IDebugDisplaySettingsData | |
| { | |
| [] | |
| private class SettingsPanel : DebugDisplaySettingsPanel | |
| { | |
| const string k_GoToSectionString = "Go to Section..."; | |
| public override DebugUI.Flags Flags => DebugUI.Flags.FrequentlyUsed; | |
| public SettingsPanel() | |
| { | |
| AddWidget(new DebugUI.RuntimeDebugShadersMessageBox()); | |
| foreach (var widget in DebugManager.instance.GetItems(DebugUI.Flags.FrequentlyUsed)) | |
| { | |
| if (widget is DebugUI.Foldout foldout) | |
| { | |
| if (foldout.contextMenuItems == null) | |
| foldout.contextMenuItems = new(); | |
| foldout.contextMenuItems.Add(new DebugUI.Foldout.ContextMenuItem | |
| { | |
| displayName = k_GoToSectionString, | |
| action = () => | |
| { | |
| var debugManger = DebugManager.instance; | |
| var panelIndex = debugManger.PanelIndex(foldout.panel.displayName); | |
| if (panelIndex >= 0) | |
| DebugManager.instance.RequestEditorWindowPanelIndex(panelIndex); | |
| } | |
| }); | |
| } | |
| AddWidget(widget); | |
| } | |
| } | |
| } | |
| // All common settings are owned by another panel, so they are treated as inactive here. | |
| /// <inheritdoc/> | |
| public bool AreAnySettingsActive => false; | |
| /// <inheritdoc/> | |
| public IDebugDisplaySettingsPanelDisposable CreatePanel() | |
| { | |
| return new SettingsPanel(); | |
| } | |
| } | |
| } | |