public virtual void Init(Role sendRole, Vector3 buffPos, AreaTriggerBuffConfig info, int insId, float beginTime) { mSendRole = sendRole; mBuffPos = buffPos; mConfigInfo = info; mInstId = insId; mBeginTime = beginTime; }
public IEnumerator loadAreaTriggerBuff(string filePath) { string url = filePath + "/config/AreaTriggerBuff.xml"; WWW www = new WWW(url); yield return(www); XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(www.text); XmlNode root = xmldoc.SelectSingleNode("root"); XmlNodeList areaBuffChilds = root.SelectNodes("AreaBuff"); foreach (XmlNode buffNode in areaBuffChilds) { AreaTriggerBuffConfig info = new AreaTriggerBuffConfig(); XmlElement buffxml = (XmlElement)buffNode; info.mTypeId = int.Parse(buffxml.GetAttribute("id")); info.mName = buffxml.GetAttribute("Name"); info.mDuration = float.Parse(buffxml.GetAttribute("Duration")); info.mShape = (AreaTriggerBuff.Shape) int.Parse(buffxml.GetAttribute("Shape")); SkillConfig.ParseVector3(ref info.mRadius, buffxml.GetAttribute("Radius")); info.mDelayTime = float.Parse(buffxml.GetAttribute("DelayTime")); info.mRepeatRate = float.Parse(buffxml.GetAttribute("RepeatRate")); info.mDestroy = (AreaTriggerBuff.Destroy) int.Parse(buffxml.GetAttribute("Destroy")); //info.mEffect //info.mDestroyEffect string behaviorBuff = buffxml.GetAttribute("BehaviorBuff"); SkillConfig.ParseBuffString(ref info.mBuffIdList, behaviorBuff, IBuff.BuffType.Behavior); string moveBuff = buffxml.GetAttribute("MoveBuff"); SkillConfig.ParseBuffString(ref info.mBuffIdList, moveBuff, IBuff.BuffType.Move); string hurtBuff = buffxml.GetAttribute("HurtBuff"); SkillConfig.ParseBuffString(ref info.mBuffIdList, hurtBuff, IBuff.BuffType.Hurt); string controlBuff = buffxml.GetAttribute("ControlBuff"); SkillConfig.ParseBuffString(ref info.mBuffIdList, controlBuff, IBuff.BuffType.Control); mAreaTriggerBuffConfigDict.Add(info.mTypeId, info); } }