void LoadXml() { TextAsset t; string data = Resources.Load("Xml/SoundConfig").ToString(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(data); XmlNodeList nodeList = xmlDoc.SelectNodes("root / node"); SoundConfigInfo info = null; foreach (XmlNode xmlNode in nodeList) { info = new SoundConfigInfo(); foreach (XmlAttribute s in xmlNode.Attributes) { switch (s.Name) { case "int_id": info.id = int.Parse(s.Value); break; case "string_path": info.path = s.Value; break; } } m_SoundConfigInfo[info.id] = info; } }
public void Start() { SoundConfigInfo info = SoundConfigReader.CreateConfig(configFileName); print(string.Format("lo:{0}, hi:{1}, dur:{2}", info.lowTime, info.hiTime, info.durTime)); StartCoroutine(PlaySounds(info.lowTime, info.hiTime, info.durTime)); }