public void StartLoadResources(string _sceneName, int _sceneIndex, Action _callBack) { PlayGameStage stage = GameCenter.curGameStage as PlayGameStage; if (stage != null) { StartCoroutine(LoadResources(mainPath, stage.GetEffectPreloadList(), _callBack)); } else { if (_callBack != null) { _callBack(); } } }
/// <summary> /// 开始加载配置数据 /// </summary> /// <param name="_data"></param> /// <param name="_callBack"></param> public void StartLoadConfig(string _sceneName, int _sceneIndex, Action _callBack) { ResourcesTotalCount = 0; ResourcesCurCount = 0; List <string> nullList = new List <string>(); foreach (var item in finalObjDic) { if (item.Value == null) { nullList.Add(item.Key); } } foreach (var item in nullList) { finalObjDic.Remove(item); } PlayGameStage stage = GameCenter.curGameStage as PlayGameStage; if (stage != null) { List <string> wholeNeeds = stage.GetEffectPreloadList(); List <string> needDelete = new List <string>(); List <string> spawnerlist = GameCenter.spawner.effectPoolCacheList; for (int i = 0; i < spawnerlist.Count; i++) { if (!wholeNeeds.Contains(spawnerlist[i])) { needDelete.Add(spawnerlist[i]); } } for (int i = 0; i < needDelete.Count; i++) { GameCenter.spawner.DeleteDefEffecterPool(needDelete[i]); } StartCoroutine(LoadConfig(mainPath, wholeNeeds, _callBack)); } else { if (_callBack != null) { _callBack(); } } }