/// <summary>
 /// Close all panels.
 /// </summary>
 public void Close()
 {
     for (int i = 0; i < m_builtinPanels.Count; i++)
     {
         if (m_builtinPanels[i] != null)
         {
             m_builtinPanels[i].Close();
         }
     }
     if (m_defaultPanel != null && !m_builtinPanels.Contains(m_defaultPanel))
     {
         m_defaultPanel.Close();
     }
     foreach (var kvp in m_actorPanelCache)
     {
         var panel = kvp.Value;
         if (panel != null && !m_builtinPanels.Contains(panel))
         {
             panel.Close();
         }
     }
     if (m_actorIdPanelCache.Count > 0)
     {
         var cachedPanels = new List <StandardUIMenuPanel>(m_actorIdPanelCache.Values);
         foreach (var kvp in m_actorIdPanelCache)
         {
             var panel = kvp.Value;
             if (panel != null && !m_builtinPanels.Contains(panel) && !cachedPanels.Contains(panel))
             {
                 panel.Close();
             }
         }
     }
     //--- No longer close cache when closing menu: ClearCache();
 }
Пример #2
0
 /// <summary>
 /// Close all panels.
 /// </summary>
 public void Close()
 {
     for (int i = 0; i < m_builtinPanels.Count; i++)
     {
         if (m_builtinPanels[i] != null)
         {
             m_builtinPanels[i].Close();
         }
     }
     if (m_defaultPanel != null && !m_builtinPanels.Contains(m_defaultPanel))
     {
         m_defaultPanel.Close();
     }
     foreach (var kvp in m_actorPanelCache)
     {
         var panel = kvp.Value;
         if (panel != null && !m_builtinPanels.Contains(panel))
         {
             panel.Close();
         }
     }
     ClearCache();
 }