public static void Read(string path) { TextAsset asset = GTResourceManager.Instance.Load <TextAsset>(path); if (asset == null) { return; } XmlDocument doc = new XmlDocument(); doc.LoadXml(asset.text); XmlElement root = doc.FirstChild as XmlElement; XmlElement child = root.FirstChild as XmlElement; while (child != null) { string idStr = child.GetAttribute("ID"); if (idStr == null) { continue; } int id = idStr.ToInt32(); ActBuff skill = new ActBuff(); skill.LoadDoc(child); Buffs.Add(id, skill); child = child.NextSibling as XmlElement; } }