public void SetData(SkillOperateData data) { uiCamera = Coo.uiCamera; this.data = data; data.receiveList.Clear(); skillButton.SetData(data); skillInfoNode.SetData(data); if (useEffect != null) { useEffect.SetData(data); } if (data.skillConfig.skillType == SkillType.Build_Replace) { BuildConfig buildConfig = War.model.GetBuildConfig(data.skillConfig.buildId); Debug.Log("data.skillId=" + data.skillId + " data.skillConfig.buildId=" + data.skillConfig.buildId); string file = buildConfig.GetLevelConfig(1).avatarConfig.Model; Debug.Log(file); GameObject prefab = WarRes.GetPrefab(file); obj = GameObject.Instantiate(prefab); obj.SetActive(false); obj.GetComponent <SpriteRenderer>().color = new Color(0.8f, 0.8f, 0.8f, 0.8f); objDestory = true; } else { switch (data.skillConfig.operate) { case SkillOperateType.SelectCircle: obj = GameObject.Instantiate(War.skillUse.selectCircleView.gameObject); obj.SetActive(false); SkillOperateSelectCircleView skillOperateSelectCircleView = obj.GetComponent <SkillOperateSelectCircleView> (); skillOperateSelectCircleView.Radius = data.skillConfig.radius; skillOperateSelectCircleView.Relation = data.skillConfig.relation; objDestory = true; break; } } selectUnitMaterialType = data.skillConfig.relation.REnemy() ? WarMaterialsType.operateSelect_Enemy : WarMaterialsType.operateSelect_Own; if (this.data != null) { rectTransform.anchoredPosition = new Vector2(-180, 56); MoveToGroove(); this.data.sSetUse += SetUse; } }
public void AddBuildLevelConfig(BuildLevelConfig buildLevelConfig) { BuildConfig buildConfig; if (!buildConfigs.TryGetValue(buildLevelConfig.id, out buildConfig)) { buildConfig = new BuildConfig(); buildConfig.id = buildLevelConfig.id; buildConfig.buildType = buildLevelConfig.buildType; buildConfigs.Add(buildConfig.id, buildConfig); } buildConfig.AddLevelConfig(buildLevelConfig); }
public void BuildChangeBuildConfig(int buildId) { RemoveBuildModule(buildLevelConfig.basepropConfig); RemoveBuildModule(buildLevelConfig.produceConfig); RemoveBuildModule(buildLevelConfig.turretConfig); RemoveBuildModule(buildLevelConfig.spotConfig); buildConfig = War.model.GetBuildConfig(buildId); levelData.CheckLevel(); AddBuildModule(buildLevelConfig.basepropConfig); AddBuildModule(buildLevelConfig.produceConfig); AddBuildModule(buildLevelConfig.turretConfig); AddBuildModule(buildLevelConfig.spotConfig); this.Props.Calculate(); avatarConfig = buildLevelConfig.avatarConfig; }
/** 生成预加载资源 */ 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); }