- Home /
Using PlayOneShot for multiple clip is OK?
I've implemented a singleton what plays clips using only one AudioSource.
As I realized I can use PlayOneShot with multiple sound, and it works well.
Is it a totally OK usage if we consider performance, programming techniques?
I have other GameObjects which don't need the singleton to play the sound, but it'd be much more simple to me to use the singleton. Is it OK as well?
thanks
I've also been using PlayOneShot for playing multiple clips on one Audio Source (in this case, SFX for different projectiles). It works just fine but I can foresee situations where you may want to adjust the levels of each SFX clip individually in the Audio $$anonymous$$ixer for example and I think that would require multiple audio sources. So I'm curious to see what others have to say about it
yeah my singleton works just fine as well, but as well I'm still curious about what others say
I think, if it doesn't sound crap (too many sounds), you don't overdo it (profiler performance, garbage collection) and don't need adjustments on the generated AudioSources this creates on the fly, you're good to go. rule of thumb, optimize in the end and if necessary.