- Home /
Question by
mingom · May 14, 2019 at 11:24 AM ·
androideditorresources.loadall
Resources.LoadAll works in editor but not on android build
A few years ago I made a simple beat machine app for android. For the sounds, I used 99 .wav files and i put them in a folder "Resources/Sounds". I loaded them all into an array at start. (see code) and it worked fine. After i updated unity editor last month and reopened this old project, it broke. In editor it shows that my 99 sounds are in an array and everything works fine. When i build the apk, the array is empty.
public class SoundArray : MonoBehaviour {
public AudioClip[] allclips;
void Start()
{
allclips = Resources.LoadAll<AudioClip>("Sounds");
foreach (AudioClip clip in allclips)
{
//do stuff
}
}
Any thoughts on why an update might break such simple code?
WIN 10, unity editor version 2019.1.2f1. Last working version was 5.5 4p4
Comment