//获得技能id public int GetSkillID(ENSkillDistanceType distanceType, ENSkillLevelType levelType = ENSkillLevelType.enNone) { int skillID = 0; List <int> skillIDList = new List <int>(); foreach (var item in Self.SkillBag) { if (distanceType != ENSkillDistanceType.enNone && item.SkillTableInfo.SkillDistanceType != (int)distanceType) { continue; } if (levelType != ENSkillLevelType.enNone && item.SkillTableInfo.SkillLevelType != (int)levelType) { continue; } if (!item.IsCanFire(Self)) { continue; } skillIDList.Add(item.SkillTableInfo.ID); } if (skillIDList.Count != 0) { skillID = skillIDList[UnityEngine.Random.Range(0, skillIDList.Count)]; } return(skillID); }
public override void Deserialize(XmlNode xmlNode) { base.Deserialize(xmlNode); XmlElement xmlElement = xmlNode as XmlElement; mSkillDistanceType = FunctionalFuncBase.ChangeStrToSkillDistanceType(xmlElement.GetAttribute("DistanceType")); mSkillLevelType = FunctionalFuncBase.ChangeStrToSkillLevelType(xmlElement.GetAttribute("LevelType")); }
public static ENSkillLevelType ChangeStrToSkillLevelType(string levelType) { ENSkillLevelType tmpLevelType = ENSkillLevelType.enNone; switch (levelType) { case "Base": tmpLevelType = ENSkillLevelType.enBase; break; case "Middle": tmpLevelType = ENSkillLevelType.enMiddle; break; case "High": tmpLevelType = ENSkillLevelType.enHigh; break; default: break; } return(tmpLevelType); }
public static int GetSkillID(Actor actor, ENSkillDistanceType disType, ENSkillLevelType levelType) { int skillId = ((AINpcBoss)actor.SelfAI).GetSkillID(disType, levelType); return(skillId); }