Exemplo n.º 1
0
        public static object GetPoolByType(PoolType type, string sourcesPath, uint maxCount = 0)
        {
            if (IsInitialed == false)
            {
                Debug.LogError("BaseObject Pool Not Initialed");
                return(null);
            }


            if (ObjectPoolTrans == null)
            {
                GenerationObjUtility.CreateObjectByName("BaseObjectPool", null, true);
            }

            object result = null;

            if (m_AllPoolDataBase.TryGetValue(type, out result))
            {
                return(result);
            }
            switch (type)
            {
            case PoolType.MsgBox:
                result = new MseeageBoxPool(sourcesPath, maxCount);
                m_AllPoolDataBase[type] = result;
                GetPoolTrans(type);
                break;
                //case PoolType.MeshLine:
                //    result = new MeshLinePool(sourcesPath, maxCount);
                //    m_AllPoolDataBase[type] = result;
                //    GetPoolTrans(type);
                //    break;
            }
            return(result);
        }
Exemplo n.º 2
0
        public static void ClearBindTip(Transform bindTrans)
        {
            MseeageBoxPool Pool = BaseObjectPool.GetPoolByType(PoolType.MsgBox, ConstDefine.UIMsgBoxResourcePath, 0) as MseeageBoxPool;

            if (Pool == null)
            {
                return;
            }

            for (int _dex = 0; _dex < allUITipMessageBoxList.Count; ++_dex)
            {
                if (allUITipMessageBoxList[_dex] != null && allUITipMessageBoxList[_dex].request != null && allUITipMessageBoxList[_dex].request.m_Parent == bindTrans)
                {
                    if (allUITipMessageBoxList[_dex].gameObject.activeSelf)
                    {
                        allUITipMessageBoxList[_dex].Hide();
                    }//if
                    else
                    {
                        Pool.Recycle(allUITipMessageBoxList[_dex], MessageBoxResquest.MessageType.TipsBox, (tips) => { tips.Reset(); });
                    }
                }//if
            }
        }