public static AudioClip LoadSE(SEFIleInfos file)
 {
     if (SoundFile._dicSEFileDictionary.ContainsKey(file))
     {
         if (SoundFile._dicSEFileDictionary.get_Item(file) != null)
         {
             return(SoundFile._dicSEFileDictionary.get_Item(file));
         }
         AudioClip audioClip = Resources.Load(string.Format("Sounds/SE/{0}", file.SEFileName())) as AudioClip;
         if (audioClip == null)
         {
             return(null);
         }
         SoundFile._dicSEFileDictionary.set_Item(file, audioClip);
     }
     else
     {
         string    text      = string.Format("Sounds/SE/{0}", file.SEFileName());
         AudioClip audioClip = Resources.Load(string.Format("Sounds/SE/{0}", file.SEFileName())) as AudioClip;
         if (audioClip == null)
         {
             return(null);
         }
         SoundFile._dicSEFileDictionary.Add(file, audioClip);
     }
     return(SoundFile._dicSEFileDictionary.get_Item(file));
 }
Ejemplo n.º 2
0
 public static AudioClip LoadSE(SEFIleInfos file)
 {
     if (_dicSEFileDictionary.ContainsKey(file))
     {
         if ((Object)_dicSEFileDictionary[file] != null)
         {
             return(_dicSEFileDictionary[file]);
         }
         AudioClip val = Resources.Load($"Sounds/SE/{file.SEFileName()}") as AudioClip;
         if ((Object)val == null)
         {
             return(null);
         }
         _dicSEFileDictionary[file] = val;
     }
     else
     {
         string    text = $"Sounds/SE/{file.SEFileName()}";
         AudioClip val  = Resources.Load($"Sounds/SE/{file.SEFileName()}") as AudioClip;
         if ((Object)val == null)
         {
             return(null);
         }
         _dicSEFileDictionary.Add(file, val);
     }
     return(_dicSEFileDictionary[file]);
 }