I have at least 15 different sounds my I want my character to make. Every time I add a new sound I create a public AudioClip object in my script and then drag the wave file to it. Is there a better way of doing this such that I can limit the number of public AudioClips to maybe just one?
Well, I can live with 15+ public slots for audio clips. I really just want to know if I'm doing it the best way. I thought maybe people create one and then through code load in what ever wav needs to be played. But this would cause a delay. Are you saying that a public slot for each sound effect my character will make is the way to do it?
Nothing wrong with having a bunch of Audio Clips in the Inspector. Playing the sounds though, it depends on how many of the sounds should be able to overlap or be interruptible. If you need the ability to have some of the sounds overlap, you'll need multiple Audio Sources as well, unless you want to fire and forget with Playoneshot. That gives up the ability to manipulate and stop the sounds after they start though. You could use the "preload audio data" turned off to save audio memory, but if you don't release the memory afterward (through code) the memory will be permanently taken up after played the first time. Having said all that, our plugin Master Audio handles all this for you with usually no coding.