void Awake() { main = this; soundEffectsDict = new Dictionary <string, AudioClip>(); AudioClip[] clips = Resources.LoadAll <AudioClip>("Audio"); for (int i = 0; i < clips.Length; i++) { string name = clips[i].name; int counter = 1; while (soundEffectsDict.ContainsKey(name)) { name = clips[i].name + "(" + counter++ + ")"; } soundEffectsDict.Add(name, clips[i]); } mixerGroups = mixer.FindMatchingGroups(""); }
// Start is called before the first frame update void Start() { instance = this; }