Hi,
I have a script which needs to have multiple audio clips (sound1, sound2 etc.)
My question is as follow: Is it better to use multiple audio components or is it better to make public audioclip variables and assign those to handmade audiosources?
in case of multiple audiocomponents: How can I address the 2 audio components? Normally I would use audio.Play(); and thats it. But nnow that there are 2 audio sources, how do I say which one to pick?
in case of audioclip variables: I tried to make audioclip variables and assigning them to audio sources, but I am getting null reference exceptions. here is how I do it:
public AudioClip c_sound1;
private AudioSource s_sound1;
//inside start()
s_sound1.clip = c_sound1;
//when space key is pressed
s_sound1.Play();
Any direction is appriciated.