protected virtual void LoadComplete(CTransport loader, CRequest creq, IList <CRequest> depens) { //#if UNITY_EDITOR // if (creq.isShared) // Debug.Log("_______loadComplete <<" + creq.key + ">> is Shared "); // else // Debug.Log("______loadComplete <<" + creq.key + ">> depens:" + (depens != null).ToString()); //#endif RemoveRequest(creq); if (depens != null) //if have depens { currentLoaded++; CRequest req1 = null; creq.dependenciesCount = depens.Count; string key = string.Empty; //Debug.Log("______begin load<" + creq.key + "> and depens :" + depens.Count.ToString()); for (int i = 0; i < depens.Count; i++) { req1 = depens[i]; req1.OnComplete += OnDependencyComp; req1.OnEnd += OnDependencyComp; req1.childrenReq = creq; key = req1.key; object cacheData = GetCache(key); if (cacheData != null) { SetReqDataFromData(req1, cacheData); req1.DispatchComplete(); continue; } LoadReq(req1); } } else { //Debug.Log("______loadComplete:<" + creq.key + "> "); object data = SetReqDataFromWWW(creq, creq.www); if (creq.isShared) { if (OnSharedComplete != null) { OnSharedComplete(creq); } } else if (creq.cache) { SetCache(creq.key, data); currentLoaded++; } Callbacklist(creq); BeginQueue(); CheckAllComplete(); } }
protected virtual void LoadComplete(CTransport loader, CRequest creq, IList <CRequest> depens) { RemoveRequest(creq); if (depens != null) //if have depens { currentLoaded++; CRequest req1 = null; creq.dependenciesCount = depens.Count; string key = string.Empty; for (int i = 0; i < depens.Count; i++) { req1 = depens[i]; req1.OnComplete += OnDependencyComp; req1.OnEnd += OnDependencyComp; req1.childrenReq = creq; key = req1.key; object cacheData = GetCache(key); if (cacheData != null) { SetReqDataFromData(req1, cacheData); req1.DispatchComplete(); continue; } LoadReq(req1); } } else { object data = SetReqDataFromWWW(creq, creq.www); if (creq.isShared) { if (OnSharedComplete != null) { OnSharedComplete(creq); } } else if (creq.cache) { SetCache(creq.key, data); currentLoaded++; } else { currentLoaded++; } Callbacklist(creq); BeginQueue(); CheckAllComplete(); } }
static public int DispatchComplete(IntPtr l) { try { CRequest self = (CRequest)checkSelf(l); self.DispatchComplete(); return(0); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
protected virtual void LoadComplete(CTransport loader, CRequest creq, IList <CRequest> depens) { RemoveRequest(creq); if (depens != null) //if have depens { currentLoaded++; CRequest req1 = null; creq.dependenciesCount = depens.Count; for (int i = 0; i < depens.Count; i++) //被依赖项目 { req1 = depens[i]; req1.OnComplete += OnDependencyComp; req1.OnEnd += OnDependencyComp; req1.childrenReq = creq; if (CacheManager.SetRequestDataFromCache(req1)) { req1.DispatchComplete(); continue; } LoadReq(req1); } } else { CacheManager.SetRequestDataFromCache(creq); if (creq.isShared) { if (OnSharedComplete != null) { OnSharedComplete(creq); } } else { currentLoaded++; } Callbacklist(creq); BeginQueue(); CheckAllComplete(); } }
protected void AddReqToQueue(CRequest req) { string key = req.udKey; if (CacheManager.SetRequestDataFromCache(req)) //如果有缓存 { req.DispatchComplete(); } else if (requestCallBackList.ContainsKey(key)) { requestCallBackList[key].Add(req); } else { requestCallBackList[key] = new List <CRequest>(); requestCallBackList[key].Add(req); queue.Add(req); if (queue.Size() == 0 && currentLoading == 0) { totalLoading = 1; currentLoaded = 0; } else if (!req.isShared) { totalLoading++; } if (pushGroup && !req.isShared) //如果是一组 { if (currGroupRequest == null) { currGroupRequest = _currGroupRequestRef; } currGroupRequest.Add(req); } } }
protected static void LoadAssetComplate(CRequest req) { req.DispatchComplete(); currentLoaded++; PopGroup(req); ClearNoABCache(req); BeginQueue(); CheckAllComplete(); }