audioClipsNames defineClipNames() { audioClipsNames names = new audioClipsNames(); names.btnClick = "sfx_UI_btnClick"; names.completeGameDing = "sfx_evt_gameComplete"; names.completeGameCoins = "sfx_evt_getCoins"; names.cashRegister = "sfx_UI_cashRegister"; names.devLvlUp = "sfx_evt_devLvlUp"; return(names); }
void Start() { controllerObj = GameObject.Find("GameController"); controller = controllerObj.GetComponent <GameController>(); source = sourceObj.GetComponent <AudioSource>(); listener = listenerObj.GetComponent <AudioListener>(); audioClips = Resources.LoadAll(audioClipsPath, typeof(AudioClip)); musicClips = Resources.LoadAll(musicClipsPath, typeof(AudioClip)); clipNames = defineClipNames(); foreach (AudioClip audio in audioClips) { audioClipDic.Add(audio.name, audio); } foreach (AudioClip music in musicClips) { musicClipDic.Add(music.name, music); } }