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); } }
public AudioClip GetAudio(string name) { return(AudioContainers.ContainsKey(name) ? AudioContainers[name] : null); }