浏览代码

Fixed a bug with persistent panel "leaking" items UI and fixed the persistent not showing up in some cases.

/RenderPassXR_Sandbox
Julien Ignace 8 年前
当前提交
e6b49830
共有 2 个文件被更改,包括 23 次插入12 次删除
  1. 20
      Assets/ScriptableRenderPipeline/Core/Debugging/DebugMenuUI.cs
  2. 15
      Assets/ScriptableRenderPipeline/Core/Debugging/DebugPanelUI.cs

20
Assets/ScriptableRenderPipeline/Core/Debugging/DebugMenuUI.cs


m_DebugMenuManager = manager;
}
// HACK: for some reason, the layout of the selected menu may fail if the previous menu in the list is disabled
// Disabling and re-enabling everything seems to fix the issue...
private void HackSelectPanel()
{
m_MainMenuRoot.SetActive(false);
m_MainMenuRoot.SetActive(true);
}
public void EnablePersistentView(bool value)
{
m_PersistentPanelRoot.SetActive(value);

m_DebugPanelUIs[m_ActivePanelIndex].SetSelected(true);
// HACK: for some reason, the layout of the selected menu may fail if the previous menu in the list is disabled
// Disabling and re-enabling everything seems to fix the issue...
m_MainMenuRoot.SetActive(false);
m_MainMenuRoot.SetActive(true);
HackSelectPanel();
}
public void NextDebugPanel()

m_DebugPanelUIs[m_ActivePanelIndex].SetSelected(true);
// HACK: for some reason, the layout of the selected menu may fail if the previous menu in the list is disabled
// Disabling and re-enabling everything seems to fix the issue...
m_MainMenuRoot.SetActive(false);
m_MainMenuRoot.SetActive(true);
HackSelectPanel();
}
public void ToggleMenu()

else
{
m_PersistentDebugPanelUI.SetSelected(true);
m_PersistentDebugPanelUI.ResetSelectedItem();
HackSelectPanel();
}
}

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


if (m_Root == null)
return;
for (int i = 0; i < m_Root.transform.childCount; ++i)
foreach (Transform child in m_Root.transform)
Object.DestroyImmediate(m_Root.transform.GetChild(i).gameObject);
GameObject.Destroy(child.gameObject);
BuildGUIImpl(m_Root);
}

DebugMenuUI.CreateTextElement(string.Format("{0} Title", m_DebugPanel.name), m_DebugPanel.name, 14, TextAnchor.MiddleLeft, m_Root);
DebugMenuUI.CreateTextElement(string.Format("{0} Title", m_DebugPanel.name), m_DebugPanel.name, 14, TextAnchor.MiddleLeft, parent);
m_ItemsUI.Clear();
for (int i = 0; i < m_DebugPanel.itemCount; i++)

return null;
}
public void ResetSelectedItem()
{
SetSelectedItem(-1);
}
void SetSelectedItem(int index)
{
if (m_SelectedItem != -1)

m_SelectedItem = index;
m_ItemsUI[m_SelectedItem].SetSelected(true);
if(m_SelectedItem != -1)
m_ItemsUI[m_SelectedItem].SetSelected(true);
}
public void SetSelected(bool value)

正在加载...
取消
保存