浏览代码

Skip drawing empty panels

/main
Thomas 7 年前
当前提交
8a390de1
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 11
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs

11
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs


s_Styles = new Styles();
var panels = DebugManager.instance.panels;
int containerCount = panels.Count(x => !x.isRuntimeOnly);
int itemCount = panels.Count(x => !x.isRuntimeOnly && x.children.Count(w => !w.isRuntimeOnly) > 0);
if (containerCount == 0)
if (itemCount == 0)
{
EditorGUILayout.HelpBox("No debug item found.", MessageType.Info);
return;

m_Settings.selectedPanel = 0;
// Validate container id
while (panels[m_Settings.selectedPanel].isRuntimeOnly)
while (panels[m_Settings.selectedPanel].isRuntimeOnly || panels[m_Settings.selectedPanel].children.Count(x => !x.isRuntimeOnly) == 0)
{
m_Settings.selectedPanel++;

if (panel.isRuntimeOnly)
continue;
if (panel.children.Count(x => !x.isRuntimeOnly) == 0)
continue;
var elementRect = GUILayoutUtility.GetRect(CoreEditorUtils.GetContent(panel.displayName), s_Styles.sectionElement, GUILayout.ExpandWidth(true));
if (m_Settings.selectedPanel == i && Event.current.type == EventType.Repaint)

// Main section - traverse current container
using (var changedScope = new EditorGUI.ChangeCheckScope())
{
using (var vscope = new EditorGUILayout.VerticalScope())
using (new EditorGUILayout.VerticalScope())
{
var selectedPanel = panels[m_Settings.selectedPanel];

正在加载...
取消
保存