/// <summary> /// Play the specified soundmanagerclip on the specified audiosource /// </summary> private void PlayThisSoundOnSource(int chnId, SoundManagerClip smc, Vector3 pos) { _fxASList[chnId].Stop(); SetInfoOnAudioSource(chnId, smc, pos); _fxASList[chnId].Play(); }
/// <summary> /// Copy the params from soundmanagerclip to the properties of the audiosource /// </summary> private void SetInfoOnAudioSource(int chnId, SoundManagerClip smc, Vector3 pos) { _fxASList[chnId].clip = smc.clip; _fxASList[chnId].loop = smc.loop; _fxASList[chnId].volume = smc.volume; _fxASList[chnId].pitch = smc.pitch; _fxASList[chnId].panStereo = smc.stereoPan; _fxASList[chnId].outputAudioMixerGroup = smc.mixerGroup; _fxASList[chnId].transform.position = pos; }