Im getting this error:
Cannot convert type `UnityEngine.Object[]' to `UnityEngine.AudioClip' via a built-in conversion
Im trying to add a bunch of audio clips to an array without having to specify them all. I have a folder in my resources folder called ‘songs’
Here is my code:
public AudioClip[] songsList;
void Start () {
songsList = new AudioClip[] {
Resources.LoadAll("songs", typeof(AudioClip)) as AudioClip
};
I have also tried it without the “typeof(AudioClip)” part, and also adding a cast before “Resources”, but I cannot get it to work.