Capstrong / Godlands

Actual game for the Capstrong DePaul capstone team
0 stars 0 forks source link

Improved Sound Manager #25

Open randomPoison opened 9 years ago

randomPoison commented 9 years ago

One way to potentially improve upon the sound manager is to create a different object pool for each unique sound being played. Since the sound setting are passed in by giving a reference to an audio source, we can use Instantiate() to duplicate that audio source and put the duplicates into pools per unique source. The Unity Gems audio pool has functionality for this, and it would be a good idea to replace the home-rolled object pool anyway.

cjacobwade commented 9 years ago

The pooling system creates a pool for each prefab and isn't applicable to the SoundManager because we want a pool of objects that each have different settings.

It seems like you don't believe me or something since you've ignored it the last 2 times I've mentioned this, so here's my reference from Unity's documentation on instantiate: http://docs.unity3d.com/ScriptReference/Object.Instantiate.html "If you are cloning a Component then the GameObject it is attached to will also be cloned, again with an optional position and rotation."