I have a set of music files in my Assets->Music folder.
I am trying to use scripting to set a different song for each level of my game. I would like to set my AudioClip into a variable and then assign it clip to the audio source at runtime. How can I get my code to find the file in the Assets->Music folder?
I’m sure this has been asked before but my research is coming up short (Thank you all in advance!)
Example Code trying to explain what I’d like to accomplish:
private AudioClip myAudioClip;
…
myAudioClip = “Assets/Music/MyFavoriteSong”
myAudioSource.clip = myAudioClip;
myAudioSource.play();