//2.创建buff特效 public BuffEffect CreateBuffEffect(Ientity buffEntity, uint buffTypeID, uint instID) { BuffConfigInfo buffInfo = ConfigReader.GetBuffInfo(buffTypeID); //判断是否有后续击飞效果 if (buffInfo != null && buffInfo.eFlyEffectID != 0) { //获取击飞信息 SkillFlyConfig skillFlycfg = ConfigReader.GetSkillFlyConfig(buffInfo.eFlyEffectID); if (skillFlycfg != null && buffEntity != null) { //Iplayer player = buffEntity as Iplayer; //被击飞信息 string beatFLyAction = skillFlycfg.moveAction; float raiseSpeed = skillFlycfg.raiseSpeed; float raiseAccSpeed = skillFlycfg.raiseAccSpeed; float fallSpeed = skillFlycfg.fallSpeed; float fallAccSpeed = skillFlycfg.fallAccSpeed; float stayTime = skillFlycfg.stayTime; int canbeRecover = skillFlycfg.bIsCanBeRecover; buffEntity.OnBeatFly(buffInfo.BuffID, beatFLyAction, raiseSpeed, raiseAccSpeed, fallSpeed, fallAccSpeed, stayTime, canbeRecover); } } //判断资源路径是否有效 if (buffInfo == null || buffInfo.EffectRes == "0") { return(null); } string resourcePath = GameConstDefine.LoadGameBuffEffectPath + buffInfo.EffectRes; //加载特效信息 BuffEffect effect = new BuffEffect(); effect.InstID = instID; effect.entity = buffEntity; effect.projectID = instID; effect.resPath = resourcePath; //创建特效 effect.Create(); //创建声音 string soundName = GameConstDefine.LoadGameSoundPath + buffInfo.sound; if (buffInfo.sound != "0") { PlayAudio(effect, soundName, effect.obj); } //保存特效列表 AddEffect(effect.projectID, effect); return(effect); }
// public void RemoveBuff(uint instID) { if (buffDict.ContainsKey(instID)) { //if (buffDict[instID].buffTypeID == 1017 && buffDict[instID].entity.GameObjGUID == PlayerManager.Instance.LocalPlayer.GameObjGUID) //{ // if (isSelfHaveBuffType(1017)) // { // } // //to do set skillbtn enable //} Buff b = buffDict[instID]; BuffConfigInfo bi = ConfigReader.GetBuffInfo(b.buffTypeID); buffDict.Remove(instID); if (bi != null) { if (bi.effectID == (int)eBuffEffect.eBuffEffectXuanYun || bi.effectID == (int)eBuffEffect.eBuffEffectShuFu) { if (b.entity != null) { if (isHaveStopBuff(b.entity.GameObjGUID) == false) { b.entity.OnEntityRomoveAstrictBuff(); } } } } //如果该Buffer带有BeatFlyMotion效果,立即取消BeatFlyMotion效果 if (b != null && bi.eFlyEffectID != 0) { //获取击飞信息 SkillFlyConfig skillFlycfg = ConfigReader.GetSkillFlyConfig(bi.eFlyEffectID); if (skillFlycfg != null && b.entity != null) { b.entity.BeatFlyFallDown(bi.BuffID); } } //refresh ui if (UIBuffUnityInterface.Instance != null) { UIBuffUnityInterface.Instance.RefreshUIItem(); } if (isSelfHaveBuffType(chenmoID) == false) { EventCenter.Broadcast <bool>(EGameEvent.eGameEvent_LocalPlayerSilence, false); } } }
public void RemoveBuff(uint instID) { if (mBuffDict.ContainsKey(instID)) { Buff b = mBuffDict[instID]; BuffConfigInfo bi = ConfigReader.GetBuffInfo(b.TypeID); mBuffDict.Remove(instID); if (bi != null) { if (bi.effectID == (int)BuffEffectEnum.XuanYun || bi.effectID == (int)BuffEffectEnum.ShuFu) { if (b.Entity != null) { if (isHaveStopBuff(b.Entity.GameObjGUID) == false) { b.Entity.OnEntityRomoveAstrictBuff(); } } } } //如果该Buffer带有BeatFlyMotion效果,立即取消BeatFlyMotion效果 if (b != null && bi.eFlyEffectID != 0) { //获取击飞信息 SkillFlyConfig skillFlycfg = ConfigReader.GetSkillFlyConfig(bi.eFlyEffectID); if (skillFlycfg != null && b.Entity != null) { b.Entity.BeatFlyFallDown(bi.BuffID); } } if (UIBuffUnityInterface.Instance != null) { UIBuffUnityInterface.Instance.RefreshUIItem(); } if (isSelfHaveBuffType(chenmoID) == false) { EventCenter.Broadcast <bool>((Int32)GameEventEnum.GameEvent_LocalPlayerSilence, false); } } }
public ReadSkillFlyConfig(string xmlFilePath) { ResourceItem xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET); TextAsset xmlfile = xmlfileUnit.Asset as TextAsset; if (!xmlfile) { Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath); } xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlfile.text); XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("SkillCfg_fly ").ChildNodes; for (int i = 0; i < infoNodeList.Count; i++) { if ((infoNodeList[i] as XmlElement).GetAttributeNode("un32ID") == null) { continue; } string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("un32ID").InnerText; SkillFlyConfig skillinfo = new SkillFlyConfig(); skillinfo.id = Convert.ToInt32(typeName); foreach (XmlElement xEle in infoNodeList[i].ChildNodes) { switch (xEle.Name) { #region 搜索 case "szName:": { skillinfo.name = Convert.ToString(xEle.InnerText); } break; case "n32RaiseSpeed": { skillinfo.raiseSpeed = Convert.ToSingle(xEle.InnerText); } break; case "n32AccSpeed": { skillinfo.raiseAccSpeed = Convert.ToSingle(xEle.InnerText); } break; case "n32FallSpeed": { skillinfo.fallSpeed = Convert.ToSingle(xEle.InnerText); } break; case "n32FallAccSpeed": { skillinfo.fallAccSpeed = Convert.ToSingle(xEle.InnerText); } break; case "n32StayTime": { skillinfo.stayTime = Convert.ToSingle(xEle.InnerText) / 1000.0f; } break; case "n32MoveAction": { skillinfo.moveAction = Convert.ToString(xEle.InnerText); } break; case "bIsCanBeRecover": { skillinfo.bIsCanBeRecover = Convert.ToInt32(xEle.InnerText); } break; #endregion } } ConfigReader.skillBeatFlyInfoDict.Add(skillinfo.id, skillinfo); } }