在web上 需要用Resources来进行加载,否则读取不到
/// <summary> /// 加载xml文档 /// </summary> /// <returns></returns> public static XmlDocument ReadAndLoadXml() { XmlDocument doc = new XmlDocument(); TextAsset textAsset = (TextAsset)Resources.Load("XMLFile1"); Debug.Log("加载xml文档"); doc.LoadXml(textAsset.text); return doc; }原文链接:https://www.f2er.com/xml/298991.html