lazrcat0/Hoarder — pull request #41 by LochNeffMonster (2014-05-27 09:19:15+00:00)
Title: Physics Sounds

I make a component script for adding dynamic sounds to objects. This means that they will make a sound when they collide with something. Right now, the set of sound types is small, but I can expand it later.

I went through and added the component to the test scenes various valuables, hence the prefab updates.

Also, I imported an audio clip of residential night ambience. I was going to apply it to the player prefab, but I figured someone might be updating that, so I should wait. It is attached to my player controller in my DynamicSoundGeneratorTest scene, so go there to take a listen. I think the volume sounds right for the setting and not too obtrusive, but that's just my hears.

To test:
* go to my DynamicSoundGeneratorTest scene
* play the scene and notice the delightful ambient audio
* then go around picking up objects that are prefabs and throw them around
* notice that they make a 3D sound that changes depending on how far away it is

Note: I plan to add different sound material types and account for cases of collision later, this is just to get some audio in the game.