Ejemplo n.º 1
0
    public static void InitSoundInfo()
    {
        TextAsset asset = Resources.Load("Default/DefaultSoundData") as TextAsset;

        if (asset != 0)
        {
            SecurityElement xml = XMLParser.LoadXML(asset.text);
            if (xml != null)
            {
                Dictionary <int, Dictionary <string, string> > dictionary = XMLParser.LoadIntMap(xml, "DefaultLanguage");
                foreach (KeyValuePair <int, Dictionary <string, string> > pair in dictionary)
                {
                    DefaulSoundData data = new DefaulSoundData {
                        id   = pair.Key,
                        path = pair.Value["path"]
                    };
                    soundDataMap.Add(pair.Key, data);
                }
            }
            else
            {
                LoggerHelper.Error("Default Sound xml null.", true);
            }
        }
        else
        {
            LoggerHelper.Error("Default Sound textAsset null.", true);
        }
    }
Ejemplo n.º 2
0
    public static void InitSoundInfo()
    {
        var textAsset = Resources.Load("Default/DefaultSoundData") as TextAsset;

        if (textAsset)
        {
            var xml = XMLParser.LoadXML(textAsset.text);
            if (xml != null)
            {
                var map = XMLParser.LoadIntMap(xml, "DefaultLanguage");
                foreach (var item in map)
                {
                    var t = new DefaulSoundData();
                    t.id   = item.Key;
                    t.path = item.Value["path"];
                    soundDataMap.Add(item.Key, t);
                }
            }
            else
            {
                LoggerHelper.Error("Default Sound xml null.");
            }
        }
        else
        {
            LoggerHelper.Error("Default Sound textAsset null.");
        }
    }
Ejemplo n.º 3
0
 public static void InitSoundInfo()
 {
     var textAsset = Resources.Load("Default/DefaultSoundData") as TextAsset;
     if (textAsset)
     {
         var xml = XMLParser.LoadXML(textAsset.text);
         if (xml != null)
         {
             var map = XMLParser.LoadIntMap(xml, "DefaultLanguage");
             foreach (var item in map)
             {
                 var t = new DefaulSoundData();
                 t.id = item.Key;
                 t.path = item.Value["path"];
                 soundDataMap.Add(item.Key, t);
             }
         }
         else
             LoggerHelper.Error("Default Sound xml null.");
     }
     else
         LoggerHelper.Error("Default Sound textAsset null.");
 }