Esempio n. 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);
        }
Esempio n. 2
0
        public TipsWindow GetTipsWindow(int id)
        {
            TipsWindow tipsWindow = (TipsWindow)tipsWindows[id];

            if (tipsWindow == null)
            {
                return(null);
            }
            return(tipsWindow);
        }
Esempio n. 3
0
        public void ClearTipsWindow(int id)
        {
            TipsWindow tipsWindow = GetTipsWindow(id);

            if (tipsWindow == null)
            {
                return;
            }
            tipsWindowPool.Enqueue(tipsWindow);
            tipsWindows.Remove(id);
        }
Esempio n. 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);
            }
        }