Hello, I have been reading a lot about Resource.Load() but I still have an error when I deploy the app in my Nexus7.
I’m trying to play 60 .png images, sequentially with this code:
dirInfo = new DirectoryInfo(resPath);
secTam = dirInfo.GetFiles().Length;
conSec = new Texture2D[secTam];
for(int i = 0; i < conSec.Length; i++){
if(i < 10){
conSec *= Resources.Load("Secuencias/Conejo/Comp 1_1_0000" + i, typeof(Texture2D)) as Texture2D;*
-
}else if(i < 100){*
conSec = Resources.Load(“Secuencias/Conejo/Comp 1_1_000” + i, typeof(Texture2D)) as Texture2D;
* }*
* }*
…
IEnumerator PlaySec(){
* playing = true;*
* for(int i = 0; i < conSec.Length; i++){*
conMat.SetTexture("MainTex", conSec*);*
* yield return new WaitForSeconds(repTime);
}
if(replay){
StopCoroutine(“PaySec”);
StartCoroutine(“PlaySec”);
}else {
playing = false;
}
}*
I have created a folder called “Resources/Secuencias/Conejo” inside the assets folder where i have put my Images with the name “Comp 1_1_000xx”.(xx[00,65])
This code is working in the editor!!
I have a OnGUI.Box telling me the length of the Texture2D array conSec[]. When I use the editor the length is 65 but when I deploy the app in the Nexus the length is 0.
What I’m doing wrong?
Thanks to all!!_