Example #1
0
        public Tips CreateTips(string info, Vector2 localPosition, Vector2 offset, float duration, Transform parent = null)
        {
            Tips tips = tipsPool.Dequeue();

            tips.InitTips(IdUtil.Generate(), info, localPosition, offset, duration, parent);
            tipss.Add(tips.id, tips);
            return(tips);
        }
Example #2
0
        public Tips GetTips(int id)
        {
            Tips tips = (Tips)tipss[id];

            if (tips == null)
            {
                return(null);
            }
            return(tips);
        }
Example #3
0
        public void ClearTips(int id)
        {
            Tips tips = GetTips(id);

            if (tips == null)
            {
                return;
            }
            tipsPool.Enqueue(tips);
            tipss.Remove(id);
        }
Example #4
0
        public void ClearAllTipss()
        {
            List <int> idList = new List <int>();

            foreach (object item in tipss.Keys)
            {
                idList.Add((int)item);
            }
            foreach (int item in idList)
            {
                Tips tips = GetTips(item);
                if (tips == null)
                {
                    return;
                }
                tipsPool.Enqueue(tips);
                tipss.Remove(item);
            }
        }