I’ve looked through the Unity documentation and watched videos trying to figure this out. With the deprecation in Unity 5 for a lot of the ways that this is done, YouTube videos and other sources aren’t that useful now.
Right now I just simply want to play a sound for an “explosion” and a “hit” when an enemy is destroyed or hit. There is an audio source component attached to the object that will play the sound (but I didn’t assign an audio clip to it because I wanted to use specific ones in the array).
I have an array:
public AudioClip audioClip;

Then with this I want to be able to PlaySound(0) or PlaySound(1).
I really don’t like the idea of being limited to one clip by attaching one to the Audio Source component. I want to be able to attach as many as I like to an array and play specific ones. I don’t know of any other way to have multiple sounds setup in the game object.
I tried different ways to play a sound in PlaySound() and have looked around for several days. I didn’t include the code for what is currently there because it doesn’t work and I made a mess of it trying different things. What code do I need to use inside of PlaySound()?
void PlaySound(int clip)
{
}
Can someone explain the way that this is done now in Unity 5?