bool LoadSlowMotionProperty() { byte[] asset = ResourceManager.Instance.GetXml("SlowMotionProperty"); if (asset == null) { return(false); } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return(false); } List <TbXmlNode> xmlNodeList = docNode.GetNodes("SlowMotion/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return(false); } for (int i = 0; i < xmlNodeListLength; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; SlowMotionProperty smp = new SlowMotionProperty(); smp.mSlowMotionId = UtilTools.IntParse(node.GetStringValue("ActionId")); smp.mSlowMotionStepList = new List <SlowMotionStep>(); List <TbXmlNode> childNode = node.GetNodes("SlowMotions"); for (int j = 0; j < childNode.Count; ++j) { TbXmlNode child = childNode[j] as TbXmlNode; SlowMotionStep sms = new SlowMotionStep(); sms.mIndex = UtilTools.IntParse(child.GetStringValue("Index")); sms.mTimeScale = UtilTools.FloatParse(child.GetStringValue("TimeScale")); sms.mTime = UtilTools.FloatParse(child.GetStringValue("Time")); sms.mFieldOfView = UtilTools.FloatParse(child.GetStringValue("FieldOfView")); smp.mSlowMotionStepList.Add(sms); } mSlowMotionPropertyDic.Add(smp.mSlowMotionId, smp); } return(true); }
bool LoadEffectProperty() { byte[] asset = ResourceManager.Instance.GetXml("effectconfig"); if (asset == null) { return(false); } TbXmlNode docNode = TbXml.Load(asset).docNode; if (docNode == null) { return(false); } List <TbXmlNode> xmlNodeList = docNode.GetNodes("effectconfig/Property"); int xmlNodeListLength = xmlNodeList.Count; if (xmlNodeListLength < 1) { return(false); } for (int i = 0; i < xmlNodeListLength; ++i) { TbXmlNode node = xmlNodeList[i] as TbXmlNode; EffectProperty ep = new EffectProperty(); int effectId = UtilTools.IntParse(node.GetStringValue("No")); ep.mEffectId = effectId; ep.mEffectModel = UtilTools.IntParse(node.GetStringValue("Model")); ep.mEffectAction = node.GetStringValue("active"); ep.mEffectFile = node.GetStringValue("FileName"); ep.mEffectPath = node.GetStringValue("Path"); ep.mEffectRemovePath = node.GetStringValue("RemoveEffect"); ep.mEffectFollowAction = node.GetIntValue("FollowAction") == 1 ? true : false; ep.mEffectDirectionType = (EffectDirectionType)UtilTools.IntParse(node.GetStringValue("EffectDirectionType")); ep.mEffectDirectionDistance = UtilTools.FloatParse(node.GetStringValue("EffectDirectionDistance")); ep.mEffectFollowRole = UtilTools.BoolParse(node.GetStringValue("EffectRotation")); ep.mEffectFollowBip = UtilTools.BoolParse(node.GetStringValue("EffectFollowBip")); mEffectPropertyDic.Add(effectId, ep); } return(true); }
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); }
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); }