using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Xml; public class ResourcesXMLReader :MonoBehaviour { static ResourcesXMLReader instance; public static ResourcesXMLReader Instance { get { return instance; } set { instance = value; } } private void Awake() { instance = this; // ReadData(); } public XmlNodeList ReadData(string XMLName, string XMLSearchingNode) { XmlDocument xml = new XmlDocument(); TextAsset textAsset = (TextAsset)Resources.Load(XMLName); xml.LoadXml(textAsset.text); // suppose that myXmlString contains "..." XmlNodeList xmList = xml.SelectNodes(XMLSearchingNode/*"/Tweets/Tweet"*/); return xmList; } }