Ejemplo n.º 1
0
    public virtual void DestroyAllWindow(List <UIWindowType> exceptionList)
    {
        destoryCacheList.Clear();
        if (dicWindowsCache != null)
        {
            //选择需要清理的UI, 排除exceptionList里面的类型
            foreach (KeyValuePair <int, UIControllerBase> ui in dicWindowsCache)
            {
                UIControllerBase baseWindow = ui.Value;
                if (exceptionList != null && exceptionList.Contains(baseWindow.UIConfigData.windowType))
                {
                    continue;
                }
                destoryCacheList.Add((int)baseWindow.ID);
                baseWindow.DestroyWindow();
            }

            //清理UI
            if (destoryCacheList.Count > 0)
            {
                for (int i = 0; i < destoryCacheList.Count; i++)
                {
                    int windowsID = destoryCacheList[i];
                    dicWindowsCache.Remove(windowsID);
                    if (dicShownWindows.ContainsKey(windowsID))
                    {
                        dicShownWindows.Remove(windowsID);
                    }
                }
            }
            backSequence.Clear();
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Destroy all window
 /// </summary>
 public virtual void DestroyAllWindow()
 {
     if (dicWindowsCache != null)
     {
         foreach (KeyValuePair <int, UIControllerBase> ui in dicWindowsCache)
         {
             UIControllerBase baseWindow = ui.Value;
             baseWindow.DestroyWindow();
         }
         dicWindowsCache.Clear();
         dicShownWindows.Clear();
         backSequence.Clear();
     }
 }