public virtual void OnEntityReleaseSkill() { SkillManagerConfig skillManagerConfig = ConfigReader.GetSkillManagerConfigInfo(EntitySkillID); if (skillManagerConfig == null) { return; } EntityComponent entityComponent = RealObject.GetComponent <EntityComponent>(); if (skillManagerConfig.isAbsorb == 1) // 吸附技能 { } else { if (skillManagerConfig.isNormalAttack == 1) // 是否是普通攻击 { entityComponent.PlayeAttackAnimation(); } else { entityComponent.PlayerAnimation(skillManagerConfig.rAnimation); } } }
public static Dictionary <int, SkillManagerConfig> Read(string xmlFilePath) { Dictionary <int, SkillManagerConfig> dic = new Dictionary <int, SkillManagerConfig>(); ResourceUnit unit = ResourceManager.Instance.LoadImmediate(xmlFilePath, EResourceType.ASSET); TextAsset xmlFile = unit.Asset as TextAsset; if (!xmlFile) { DebugEx.LogError("no xml file"); } XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlFile.text); XmlNodeList infoNodeList = doc.SelectSingleNode("SkillCfg_manager").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; SkillManagerConfig info = new SkillManagerConfig(); info.id = Convert.ToInt32(typeName); foreach (XmlElement xEle in infoNodeList[i].ChildNodes) { #region 搜索 switch (xEle.Name) { case "szName": { info.name = Convert.ToString(xEle.InnerText); } break; case "bIfNormalAttack": { info.isNormalAttack = Convert.ToInt32(xEle.InnerText); } break; case "n32PrepareAction": { info.yAnimation = Convert.ToString(xEle.InnerText); } break; case "n32PrepareTime": { info.yTime = Convert.ToInt32(xEle.InnerText) / 1000.0f; } break; case "n32PrepareEffect": { info.yEffect = Convert.ToString(xEle.InnerText); } break; case "n32ReleaseSound": { info.rSound = Convert.ToString(xEle.InnerText); } break; case "n32ReleaseAction": { info.rAnimation = Convert.ToString(xEle.InnerText); } break; case "n32ReleaseEffect": { info.rEffect = Convert.ToString(xEle.InnerText); } break; case "n32PrepareSound": { info.ySound = Convert.ToString(xEle.InnerText); } break; case "eUseWay": { info.useWay = Convert.ToInt32(xEle.InnerText); } break; case "eTargetType": { info.targetType = Convert.ToInt32(xEle.InnerText); } break; case "SkillIcon": { info.skillIcon = Convert.ToString(xEle.InnerText); } break; case "info": { info.info = Convert.ToString(xEle.InnerText); } break; case "n32CoolDown": { info.coolDown = Convert.ToInt32(xEle.InnerText); } break; case "n32ReleaseDistance": { info.range = Convert.ToInt32(xEle.InnerText) / 100.0f; } break; case "eSummonEffect": { info.absorbRes = Convert.ToString(xEle.InnerText); } break; case "bIsConsumeSkill": { info.isAbsorb = Convert.ToInt32(xEle.InnerText); } break; case "n32UpgradeLevel": { info.n32UpgradeLevel = Convert.ToInt32(xEle.InnerText); } break; case "n32UseMP": { info.mpUse = Convert.ToSingle(xEle.InnerText); } break; case "n32UseHP": { info.hpUse = Convert.ToSingle(xEle.InnerText); } break; case "n32UseCP": { info.cpUse = Convert.ToSingle(xEle.InnerText); } break; #endregion } } dic.Add(info.id, info); } return(dic); }