示例#1
0
        public void LoadAbort(int id)
        {
            var handler = AssetLoadHandlerManager.GetInstance().GetLoadHandler(id);

            if (handler != null)
            {
                handler.loader?.StopLoad(handler);
            }
        }
示例#2
0
文件: BaseLoader.cs 项目: cnscj/THSTG
        protected AssetLoadHandler GetOrCreateHandler(string path)
        {
            //先判断正作加载的队列中是否已经正在加载
            AssetLoadHandler handler = null;

            if (m_loadingMap != null && m_loadingMap.TryGetValue(path, out handler))
            {
                return(handler);
            }

            handler = AssetLoadHandlerManager.GetInstance().GetOrCreateHandler();
            handler.timeoutChecker.UpdateTick();
            handler.path = path.ToLower();
            return(handler);
        }
示例#3
0
        protected override void OnRelease()
        {
            //递归释放
            if (m_children != null && m_children.Count > 0)
            {
                for (int i = m_children.Count - 1; i >= 0; i--)
                {
                    var handler = m_children[i];
                    handler.m_parents?.Remove(this);
                    handler.Release();
                }
            }

            //TODO:这里进行释放操作

            AssetLoadHandlerManager.GetInstance().RecycleHandler(this);
        }