public static void LoadSuitConfig(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } SuitInfo info; for (int i = 0; i < xmlNodeList.Count; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; info = new SuitInfo(); info.id = node.GetIntValue("id"); info.nameID = node.GetStringValue("name"); info.equipId = node.GetStringValue("equiq"); info.suitAdd = node.GetStringValue("suitadd"); if (configList.ContainsKey(info.id)) { configList[info.id] = info; } else { configList.Add(info.id, info); } } asset = null; }
static void LoadClothesConfig(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } BabyStar info; for (int i = 0; i < xmlNodeList.Count; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; info = new BabyStar(); info.id = node.GetIntValue("id"); info.extent = node.GetStringValue("extent"); info.state = node.GetIntValue("state"); info.addvalue = node.GetStringValue("addvalue"); if (configList.ContainsKey(info.id)) { configList[info.id] = info; } else { configList.Add(info.id, info); } } asset = null; }
/// <summary> /// 加载消耗品配置 /// </summary> public static void LoadConsuleConfig(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } ConsumeItemInfo info; for (int i = 0; i < xmlNodeList.Count; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; info = new ConsumeItemInfo(); info.itemID = node.GetStringValue("id"); info.propValue = node.GetIntValue("addValue"); if (consumemList.ContainsKey(info.itemID)) { consumemList[info.itemID] = info; } else { consumemList.Add(info.itemID, info); } } asset = null; }
public override void onloaded(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } TbXmlNode node = xmlNodeList[0] as TbXmlNode; offX = node.GetFloatValue("offX"); offY = node.GetFloatValue("offY"); offZ = node.GetFloatValue("offZ"); pX = node.GetFloatValue("pX"); pY = node.GetFloatValue("pY"); pZ = node.GetFloatValue("pZ"); rX = node.GetFloatValue("rX"); rY = node.GetFloatValue("rY"); rZ = node.GetFloatValue("rZ"); bound = node.GetStringValue("bound"); fieldView = node.GetFloatValue("fieldView"); asset = null; base.onloaded(data); }
bool LoadAudioProperty() { byte[] asset = ResourceManager.Instance.GetXml("AudioProperty"); if (asset == null) { return(false); } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return(false); } List <TbXmlNode> xmlNodeList = docNode.GetNodes("AudioProperty/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return(false); } for (int i = 0; i < xmlNodeListLength; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; AudioProperty sp = new AudioProperty(); string AudioKey = node.GetStringValue("AudioKey"); sp.mAudioModel = node.GetStringValue("AudioModel"); sp.mAudioAction = node.GetStringValue("AudioAction"); sp.mAudioResource = node.GetStringValue("AudioResource"); sp.mAudioVolume = UtilTools.FloatParse(node.GetStringValue("AudioVolume")); sp.mAudioFrontTime = UtilTools.FloatParse(node.GetStringValue("AudioFrontTime")); sp.mAudioLoop = node.GetStringValue("AudioLoop").Equals("true") ? true : false; mAudioPropertyDic.Add(AudioKey, sp); } return(true); }
bool LoadSkillProperty() { byte[] asset = ResourceManager.Instance.GetXml("SkillProperty"); if (asset == null) { return(false); } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return(false); } List <TbXmlNode> xmlNodeList = docNode.GetNodes("SkillProperty/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return(false); } for (int i = 0; i < xmlNodeListLength; ++i) { SkillProperty sp = new SkillProperty(); TbXmlNode node = xmlNodeList[i] as TbXmlNode; sp.mSkillId = node.GetIntValue("No"); sp.mSkillName = node.GetStringValue("Name"); sp.mSkillOwnerId = node.GetIntValue("Model"); sp.mSkillIndex = node.GetIntValue("SkillNumber"); sp.mSkillSpace = node.GetFloatValue("SkillSpace"); sp.mSkillConsumptionType = (SkillConsumptionType)node.GetIntValue("SkillConsumptionType"); sp.mSkillConsumptionValue = node.GetIntValue("SkillConsumptionValue"); sp.mAnimatorSkillProperty = new AnimatorSkillProperty(); mSkillPropertyDic.Add(sp.mSkillId, sp); } return(true); }
static void LoadConfigInfo(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } RankRewardInfo info; for (int i = 0; i < xmlNodeList.Count; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; info = new RankRewardInfo(); info.id = node.GetIntValue("ID"); info.robRewardID = node.GetStringValue("robRewardID"); info.rewardID = node.GetStringValue("rewardID"); if (bossRewardList.ContainsKey(info.id)) { bossRewardList[info.id] = info; } else { bossRewardList.Add(info.id, info); } } asset = null; }
static void LoadConfigInfo(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } BossDailyInfo info; for (int i = 0; i < xmlNodeList.Count; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; info = new BossDailyInfo(); info.day = node.GetIntValue("ID"); info.bossID = node.GetIntValue("boosID"); info.openTime = node.GetStringValue("openTime"); if (bossDailyList.ContainsKey(info.day)) { bossDailyList[info.day] = info; } else { bossDailyList.Add(info.day, info); } } asset = null; }
static void LoadUseEquipConfig(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } EquipUseInfo info; for (int i = 0; i < xmlNodeList.Count; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; info = new EquipUseInfo(); info.star = node.GetIntValue("id"); info.exp = node.GetIntValue("exp"); info.money = node.GetIntValue("money"); if (configList.ContainsKey(info.star)) { configList[info.star] = info; } else { configList.Add(info.star, info); } } asset = null; }
public static void LoadCommonConfig(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } CommonInfo info; for (int i = 0; i < xmlNodeList.Count; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; info = new CommonInfo(); info.id = node.GetIntValue("ID"); info.value = node.GetIntValue("value"); if (List.ContainsKey(info.id)) { List[info.id] = info; } else { List.Add(info.id, info); } } asset = null; }
static void LoadSkillInfo(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } SkillLevelInfo info; for (int i = 0; i < xmlNodeList.Count; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; info = new SkillLevelInfo(); info.id = node.GetIntValue("ID"); info.limit = node.GetIntValue("limit"); if (skillInfoList.ContainsKey(info.id)) { skillInfoList[info.id] = info; } else { skillInfoList.Add(info.id, info); } } asset = null; }
public bool LoadAnimatorSkillProperty() { byte[] asset = ResourceManager.Instance.GetXml("AnimatorConfig"); if (asset == null) { return(false); } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return(false); } List <TbXmlNode> xmlNodeList = docNode.GetNodes("animatorconfig/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return(false); } for (int i = 0; i < xmlNodeListLength; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; AnimatorSkillProperty asp = new AnimatorSkillProperty(); asp.mySkillId = node.GetIntValue("No"); asp.mySkillAction = node.GetIntValue("Action"); asp.mSkillActionProperty = new Dictionary <int, SkillActionProperty>(); List <TbXmlNode> childNode = node.GetNodes("Action"); asp.mySkillActionCount = childNode.Count; for (int j = 0; j < asp.mySkillActionCount; ++j) { TbXmlNode child = childNode[j] as TbXmlNode; SkillActionProperty sap = new SkillActionProperty(); sap.ActionNumberId = child.GetIntValue("ActionNumber"); sap.mSkillTargetType = (SkillTargetType)child.GetIntValue("TargetType"); sap.mSkillReleaseType = (SkillReleaseType)child.GetIntValue("SkillReleaseType"); sap.mSkillFlyRes = child.GetStringValue("SkillFlyRes"); sap.mSkillType = (SkillType)child.GetIntValue("SkillType"); string skillTypeParams = child.GetStringValue("SkillTypeParams"); if (skillTypeParams == null || skillTypeParams.Equals("")) { sap.mSkillTypeParams = new List <float>(); sap.mSkillTypeParams.Add(1f); } else { sap.mSkillTypeParams = new List <float>(); string[] s = skillTypeParams.Split(','); for (int k = 0; k < s.Length; k++) { sap.mSkillTypeParams.Add(UtilTools.FloatParse(s[k])); } } sap.mPauseTime = UtilTools.FloatParse(child.GetStringValue("PauseTime")); sap.mCenterOffset = UtilTools.FormatStringVector3(child.GetStringValue("CenterOffset")); sap.mSkillRangeType = (SkillRangeType)child.GetIntValue("SkillRangeType"); string skillRangeTypeParams = child.GetStringValue("SkillRangeTypeParams"); if (skillRangeTypeParams == null || skillRangeTypeParams.Equals("")) { sap.mSkillRangParametr = null; } else { sap.mSkillRangParametr = new List <float>(); string[] s = skillRangeTypeParams.Split(','); for (int k = 0; k < s.Length; k++) { sap.mSkillRangParametr.Add(UtilTools.FloatParse(s[k])); } } sap.mHurtEffectId = child.GetIntValue("HurtEffect"); sap.mDamageStatus = child.GetIntValue("DamageStatus"); sap.mDebuffId = child.GetIntValue("DebuffId"); sap.mAttackerPauseTime = UtilTools.FloatParse(child.GetStringValue("AttackerPauseTime")); sap.mCameraShakeNumber = child.GetIntValue("CameraShakeNumber"); sap.mCameraShakeDistance = UtilTools.FloatParse(child.GetStringValue("CameraShakeDistance")); sap.mCameraShakeSpeed = UtilTools.FloatParse(child.GetStringValue("CameraShakeSpeed")); sap.mRepelType = child.GetIntValue("RepelType"); sap.mHurtDir = child.GetIntValue("HurtDir"); sap.mShakeRotationX = UtilTools.FloatParse(child.GetStringValue("RotationX")); sap.mShakeDecay = UtilTools.FloatParse(child.GetStringValue("ShakeDecay")); sap.mTopplebackType = child.GetIntValue("TopplebackType"); asp.mSkillActionProperty.Add(sap.ActionNumberId, sap); } if (mSkillPropertyDic.ContainsKey(asp.mySkillId)) { mSkillPropertyDic[asp.mySkillId].mAnimatorSkillProperty = asp; } } return(true); }
bool LoadProperty() { byte[] asset = ResourceManager.Instance.GetXml("Property"); if (asset == null) { return(false); } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return(false); } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Property/ObjProperty"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return(false); } for (int i = 0; i < xmlNodeListLength; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; int objId = node.GetIntValue("ObjId"); List <Property> list = new List <Property>(); List <TbXmlNode> childNode = node.GetNodes("Propertys"); for (int j = 0; j < childNode.Count; ++j) { TbXmlNode child = childNode[j] as TbXmlNode; Property fp = new Property(); fp.mPropName = child.GetStringValue("PropName"); fp.mVarType = child.GetIntValue("Type"); switch (fp.mVarType) { case VarType.Int: fp.mValue = new Var(fp.mVarType, UtilTools.IntParse(child.GetStringValue("Value"))); break; case VarType.Float: fp.mValue = new Var(fp.mVarType, UtilTools.FloatParse(child.GetStringValue("Value"))); break; case VarType.Int64: fp.mValue = new Var(fp.mVarType, UtilTools.LongParse(child.GetStringValue("Value"))); break; case VarType.String: fp.mValue = new Var(fp.mVarType, child.GetStringValue("Value")); break; default: fp.mValue = Var.zero; break; } list.Add(fp); } mPropertyDic.Add(objId, list); } return(true); }
public override void onloaded(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } m_teamData = new Dictionary <int, TD_TeamSkin>(); TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } TD_TeamSkin item; for (int i = 0; i < xmlNodeListLength; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; item = new TD_TeamSkin(); item.team = node.GetIntValue("team"); item.teamName = node.GetStringValue("teamName"); item.cloth = node.GetStringValue("cloth"); item.mainClothColor = node.GetIntValue("mainClothColor"); item.cloth2 = node.GetStringValue("cloth2"); item.mainClothColor2 = node.GetIntValue("mainClothColor2"); item.skin = node.GetStringValue("skin"); item.hair = node.GetStringValue("hair"); m_teamData[item.team] = item; } xmlNodeList = docNode.GetNodes("Object/GKProperty"); xmlNodeListLength = xmlNodeList.Count; TD_GKSkin gkItem = null; for (int i = 0; i < xmlNodeListLength; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; gkItem = new TD_GKSkin(); gkItem.cloth = node.GetStringValue("cloth"); gkItem.cloth2 = node.GetStringValue("cloth2"); gkItem.cloth3 = node.GetStringValue("cloth3"); gkItem.skin = node.GetStringValue("skin"); gkItem.skin2 = node.GetStringValue("skin2"); gkItem.skin3 = node.GetStringValue("skin3"); gkItem.hair = node.GetStringValue("hair"); gkItem.hair2 = node.GetStringValue("hair2"); gkItem.hair3 = node.GetStringValue("hair3"); } m_gkData = gkItem; asset = null; if (null != m_callBack) { m_callBack(); m_callBack = null; } base.onloaded(data); }
public override void onloaded(AssetBundles.NormalRes data) { byte[] asset = (data as AssetBundles.BytesRes).m_bytes; if (asset == null) { return; } m_data = new List <TD_Hero>(); TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return; } List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return; } TD_Hero item; for (int i = 0; i < xmlNodeListLength; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; item = new TD_Hero(); item.id = node.GetIntValue("hero_id"); item.res = node.GetStringValue("hero_res"); item.name = node.GetStringValue("hero_name"); item.type = (E_HeroType)node.GetIntValue("hero_type"); item.skinRes = node.GetStringValue("skin_res"); item.hero_dis = node.GetStringValue("hero_dis"); item.hp = node.GetIntValue("hp"); item.shield = node.GetIntValue("shield"); item.headRes = node.GetStringValue("hero_head"); item.arcane_list = node.GetStringValue("arcane_list"); item.arcaneInitalSkill = node.GetIntValue("arcane_initial_list"); item.card_list = node.GetStringValue("card_list"); item.card_initial_list = node.GetStringValue("card_initial_list"); item.awake = node.GetStringValue("awake"); item.hero_occupy = node.GetIntValue("hero_occupy"); item.hero_atked = node.GetStringValue("hero_atked"); item.hero_voice1 = node.GetStringValue("hero_voice1"); item.hero_voice2 = node.GetStringValue("hero_voice2"); item.hero_voice3 = node.GetStringValue("hero_voice3"); item.hero_voice4 = node.GetStringValue("hero_voice4"); item.hero_voice5 = node.GetStringValue("hero_voice5"); item.deck_build = node.GetIntValue("deck_build"); m_data.Add(item); } asset = null; if (null != m_callBack) { m_callBack(); m_callBack = null; } base.onloaded(data); }