public void Play(string playId, SAudioClip clip, ulong delay, float volume, Action<SAudioSource> callback) { SAudioSource source = audioSourcePool.Request(); if(source != null) { Add(source, clip.channel.name); source.Play(playId, clip, delay, volume, callback); } }
/// <summary> /// Play function to play the clip with a collection of settings /// </summary> /// <param name="audioClip">Audio clip to play</param> /// <param name="delay">Delay before the audio is played</param> /// <param name="volume">Volume of the audio source</param> /// <param name="callback"></param> public void Play(string id, SAudioClip audioClip, ulong delay = 0, float volume = 1.0f, Action<SAudioSource> callback = null) { playId = id; channel = audioClip.channel.name; audioSource.clip = audioClip.clip; audioSource.volume = volume; audioSource.Play(delay); initialVolume = volume; completeCallback = callback; }