public void HideUI(string uiName) { if (!m_uiDic.ContainsKey(uiName)) { return; } Jyx2_UIBase uibase = m_uiDic[uiName]; if (m_normalUIStack.Contains(uibase)) { PopUI(uibase, m_normalUIStack); } else if (m_PopUIStack.Contains(uibase)) { PopUI(uibase, m_PopUIStack); } else if (uibase.Layer == UILayer.MainUI) { uibase.Hide(); } else { uibase.Hide(); } }
void PushUI(Jyx2_UIBase uibase) { switch (uibase.Layer) { case UILayer.MainUI: if (m_currentMainUI && m_currentMainUI != uibase) { m_currentMainUI.Hide(); } m_currentMainUI = uibase; break; case UILayer.NormalUI: m_normalUIStack.Push(uibase); break; case UILayer.PopupUI: m_PopUIStack.Push(uibase); break; } }
void PopUI(Jyx2_UIBase ui, Stack <Jyx2_UIBase> uiStack) { if (!uiStack.Contains(ui)) { return; } Jyx2_UIBase node = uiStack.Pop(); while (node) { if (node == ui) { node.Hide(); return; } if (uiStack.Count <= 0) { return; } node.Hide(); node = uiStack.Pop(); } }