Example #1
0
        public TipsWindow CreateTipsWindow(string title, string info, string confirm, string cancel, Transform parent = null)
        {
            TipsWindow tipsWindow = tipsWindowPool.Dequeue();

            tipsWindow.InitTipsWindow(IdUtil.Generate(), true, title, info, confirm, cancel, parent);
            tipsWindows.Add(tipsWindow.id, tipsWindow);
            return(tipsWindow);
        }
Example #2
0
        public TipsWindow GetTipsWindow(int id)
        {
            TipsWindow tipsWindow = (TipsWindow)tipsWindows[id];

            if (tipsWindow == null)
            {
                return(null);
            }
            return(tipsWindow);
        }
Example #3
0
        public void ClearTipsWindow(int id)
        {
            TipsWindow tipsWindow = GetTipsWindow(id);

            if (tipsWindow == null)
            {
                return;
            }
            tipsWindowPool.Enqueue(tipsWindow);
            tipsWindows.Remove(id);
        }
Example #4
0
        public void ClearAllTipsWindows()
        {
            List <int> idList = new List <int>();

            foreach (object item in tipsWindows.Keys)
            {
                idList.Add((int)item);
            }
            foreach (int item in idList)
            {
                TipsWindow tipsWindow = GetTipsWindow(item);
                if (tipsWindow == null)
                {
                    return;
                }
                tipsWindowPool.Enqueue(tipsWindow);
                tipsWindows.Remove(item);
            }
        }