Friday, September 28, 2012

Audio Manager

Since we knew sound was going to be integral to our experience as a bad-ass ninja, I built the Audio 

Manager class , and built it so it would be simple to use despite any drastic changes that may come down the 

line. 


Therefore, I made it a static class that took in a string referencing the audio clip in the Sounds folder. This 

made the class easily accessible by anyone that needed to use it. Of course, I had to wrap the function a bit

to be adaptable to what the programmer needed. In particular, the ability to designate whether the sound 

needed to be a 3D positional sound or a global sound the player would hear anywhere.


Thus, I built the PlayClip function to split into two functions depending on whether the player supplied a 

Vector3 position. The function branches slightly depending on whether a position is supplied or not, but the

overall simplicity of accessing it is more than worth it.

No comments:

Post a Comment