Ejemplo n.º 1
0
        /// <summary>
        /// Loads the XML (sounds.xml)
        /// </summary>
        private void LoadXML()
        {
            soundList = new List <XMLSound>();
            TextAsset textAsset = (TextAsset)Resources.Load("sounds");

            soundsXML = new XmlDocument();

            try
            {
                soundsXML.LoadXml(textAsset.text);
            }
            catch (NullReferenceException exception)
            {
                Debug.LogWarning("sound.xml not found. You can still use Tamboro.SoundManager.Play() provided that use a sound clip instead of the name of the sound " + exception);
            }

            XmlNodeList elemList = soundsXML.GetElementsByTagName("sounds");

            for (int i = 0; i < elemList.Count; i++)
            {
                foreach (XmlNode chldNode in elemList[i].ChildNodes)
                {
                    XMLSound sound = new XMLSound(chldNode.ChildNodes[0].InnerText, chldNode.ChildNodes[1].InnerText, chldNode.ChildNodes[2].InnerText);
                    soundList.Add(sound);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads the XML (sounds.xml)
        /// </summary>
        private void LoadXML()
        {
            soundList = new List<XMLSound>();
            TextAsset textAsset = (TextAsset)Resources.Load("sounds");
            soundsXML = new XmlDocument();

            try
            {
                soundsXML.LoadXml(textAsset.text);
            }
            catch (NullReferenceException exception)
            {
                Debug.LogWarning("sound.xml not found. You can still use Tamboro.SoundManager.Play() provided that use a sound clip instead of the name of the sound " + exception);
            }

            XmlNodeList elemList = soundsXML.GetElementsByTagName("sounds");
            for (int i = 0; i < elemList.Count; i++)
            {
                foreach (XmlNode chldNode in elemList[i].ChildNodes)
                {
                    XMLSound sound = new XMLSound(chldNode.ChildNodes[0].InnerText, chldNode.ChildNodes[1].InnerText, chldNode.ChildNodes[2].InnerText);
                    soundList.Add(sound);
                }
            }
        }