public SoundObject SpawnSoundObject(Transform transform, AudioClip audioClipToPlay, bool destroyWhenFinished = true, bool isLoop = false) { SoundObject soundObject = SpawnSoundObject(audioClipToPlay); if (soundObject) { soundObject.PlaySound(transform, audioClipToPlay, destroyWhenFinished, isLoop); } return(soundObject); }
public SoundObject SpawnSoundObject(Vector3 position, AudioClip audioClipToPlay, bool destroyWhenFinished = true, bool isLoop = false) { SoundObject soundObject = SpawnSoundObject(audioClipToPlay); if (soundObject) { soundObject.PlaySound(position, audioClipToPlay, destroyWhenFinished, isLoop); } return(soundObject); }