Пример #1
0
        private void LoadAudio()
        {
            foreach (var path in AudioPath)
            {
                AudioClip obj = Resources.Load <AudioClip>(path);

                if (AudioContainers.ContainsKey(obj.name))
                {
                    throw new System.Exception($"存在重名文件{obj.name}!");
                }

                AudioContainers.Add(obj.name, obj);
            }
        }
Пример #2
0
 public AudioClip GetAudio(string name)
 {
     return(AudioContainers.ContainsKey(name) ? AudioContainers[name] : null);
 }