Пример #1
0
        public void FreeItemGameObj(GameObject obj)
        {
            if (cachedItems == null)
            {
                return;
            }

            UIItemNewSlot.Bind(obj).Dispose();

            cachedItems.FreeTemplateInstance(obj);
        }
Пример #2
0
        /// <summary>
        /// 放回到缓存池
        /// </summary>
        /// <param name="name"></param>
        /// <param name="gameobj"></param>
        public void FreeTemplate(string name, GameObject gameobj)
        {
            if (!IsTemplateExist(name))
            {
                GameDebug.LogError("template not exist:" + name);
                return;
            }

            TemplateCache cache = this.templateDic[name];

            cache.FreeTemplateInstance(gameobj);
        }