/** 生成预加载资源 */ public static void GenerationPreloadList() { preloadList.Clear(); List <string> list = preloadList; // for(int colorId = 0; colorId < 3; colorId ++) // { // for (int leveId = 0; leveId < 3; leveId++) // { // list.Add("unit_prefab/turret/t_01_jianta_"+ colorId + "_" + leveId); // } // list.Add("unit_prefab/spot/spot_01_zhangpeng_"+ colorId ); // } int stageId = War.sceneData.id; if (!War.model.stagePaths.ContainsKey(stageId)) { list.Add(StagePathData.GetFilePath(stageId)); } list.Add(WarRes.e_legionexp_l); list.Add(WarRes.e_legionexp_m); list.Add(WarRes.e_legionexp_s); list.Add(WarRes.e_spot_change); list.Add(WarRes.e_target_build_own); list.Add(WarRes.e_buffstate_atk_up); list.Add(WarRes.e_buffstate_movespeed_up); list.Add(WarRes.e_buffstate_producespeed_up); list.Add(WarRes.Turret_Fx_Projectile); list.Add(WarRes.Turret_Fx_Explosion); list.Add(WarRes.SendArmy); list.Add(WarRes.Unit_Hun); list.Add(WarRes.Unit_AtkRadius); list.Add(WarRes.Unit_Shadow); list.Add(WarRes.Unit_Prefab_UnitPathGroup); list.Add(WarRes.Unit_Prefab_Solider); list.Add(WarRes.Unit_Build_Casern); list.Add(WarRes.Unit_Build_Turret); list.Add(WarRes.Unit_Build_Spot); list.Add(WarRes.Unit_Player); list.Add(WarRes.Unit_Hero); list.Add(WarRes.Unit_Wall); list.Add(WarRes.WarViews_UnitHP); list.Add(WarRes.WarViews_UnitClock); list.Add(WarRes.WarViews_UnitSOS); list.Add(WarRes.WarViews_HeroHead); list.Add(WarRes.WarViews_SkillHeadButton); list.Add(WarRes.War_View_SkillOperate_SelectUnit); list.Add(WarRes.effect_solider_walk); list.Add(WarRes.effect_soldiers_die); // list.Add(WarRes.effect_soldier_one_die); list.Add(WarRes.Effect_Beattack); list.Add(WarRes.build_legion_chenge); if (list.IndexOf(WarRes.Effect_Uplevel) == -1) { list.Add(WarRes.Effect_Uplevel); } list.Add(War.sceneData.mapConfig.terrain); list.Add(War.sceneData.mapConfig.buildGround); foreach (KeyValuePair <int, UnitData> buildKVP in War.sceneData.buildDict) { BuildConfig buildConfig = buildKVP.Value.buildConfig; buildConfig.GetResList(list, War.sceneData.colorIds); } foreach (KeyValuePair <int, UnitData> wallKVP in War.sceneData.wallDict) { string file = wallKVP.Value.prefabFile; if (list.IndexOf(file) == -1) { list.Add(file); } } foreach (KeyValuePair <int, LegionData> legionKVP in War.sceneData.legionDict) { string file = legionKVP.Value.soliderData.prefabFile; if (list.IndexOf(file) == -1) { list.Add(file); } foreach (KeyValuePair <int, SkillOperateData> skillKVP in legionKVP.Value.skillDatas) { skillKVP.Value.skillConfig.GetRes(list); } } }
/** 获取资源列表 */ public List <string> GetRes(List <string> list) { if (list == null) { list = new List <string>(); } string file; foreach (SkillWarConf skillWarConfig in skillWarConfigList) { foreach (CSkillEffectDataItem effectDic in skillWarConfig.effectDataList) { if (skillWarConfig != null) { file = effectDic.animPathEnd; if (file != "temp" && !string.IsNullOrEmpty(file)) { if (list.IndexOf(file) == -1) { list.Add(file); } } // Debug.Log(string.Format("res add====:{0}:{1}:{2}", effectDic.Value.animPathEnd, // effectDic.Value.animPathStart, effectDic.Value.buffAnimPath)); file = effectDic.animPathStart; if (file != "temp" && !string.IsNullOrEmpty(file)) { if (list.IndexOf(file) == -1) { list.Add(file); } } file = effectDic.buffAnimPath; if (file != "temp" && !string.IsNullOrEmpty(file)) { if (list.IndexOf(file) == -1) { list.Add(file); } } } } } if (skillType != SkillType.Normal) { if (buildId > 0) { // Debug.Log("skillId=" + skillId + " buildId=" + buildId); BuildConfig buildConfig = War.model.GetBuildConfig(buildId); buildConfig.GetResList(list, War.sceneData.colorIds); } if (buildModuleConfig != null && buildModuleConfig.avatarConfig != null) { buildModuleConfig.avatarConfig.GetResList(list, War.sceneData.colorIds); } } return(list); }