AudioSource.PlayOneShot performance

Hi,

I want to know your views on the performance differences between the use PlayOneShot() and creating/destroying AudioSources (and subsequently assigning audioClips to these sources then playing them) at runtime.

Which method would you guys recommend to play short clips (for SFXs) with performance in mind?

Thanks

I can't really comment on the performance characteristics, but I'd imagine that the overhead of repeatedly creating and destroying game objects will generally be greater than that of reusing the same game objects (search the forums for 'pooling' for further discussion on this).

I use pooling for audio sources, and that's worked well for me. (Specifically, all audio playback requests go through a central audio manager that creates persistent 'audio channel' game objects as needed. These objects persist between levels, so they're never destroyed; they're just reused repeatedly.)