/**执行异步加载*/ private IEnumerator loadFromHttp(LoadItem item) { item.www = WWW.LoadFromCacheOrDownload(item.url, 1); item.loadBeginTime = Environment.TickCount; yield return(item.www); if (isTrace) { Log.info(this, "-loadFromHttp() url:" + item.url + " 远程加载完成!"); } if (loadingList.IndexOf(item) != -1) { loadingList.Remove(item); } if (loadFailList.ContainsKey(item.url)) { loadFailList.Remove(item.url); } ResPool.instance.addLoadedRes(item.url, item.www.assetBundle.mainAsset); loadback(item.url); item = null; loadNext(); }
/**加载场景文件**/ internal void loadScene(uint mapId, LoadItem item, LoadProgressBack progresFun = null) { loadSceneItem = item; this.progresFun = progresFun; StartCoroutine(startLoadScene(mapId, loadSceneItem.url)); }
/**等待时间检查 * @return [true:超时,false:未超时] * **/ private bool isOvertimes(LoadItem task) { int time = Environment.TickCount; return(time - task.loadBeginTime >= overtime ? true : false); }
internal void loadScene(uint mapId, LoadItem item, LoadProgressBack progresFun = null) { UnityEngine.Debug.Log("****loadScene, mapId = " + mapId); binLoadMgr.loadScene(mapId, item, progresFun); }