I’m making a tiny video - just 3 seconds - to play in my game. The playing part of the code seems alright, but I have to assign 200 textures into an array by hand.
I tried to make something in start() which would access the folder with the textures and create an array that I could use.
This is what I put in start(), but it just says that images is assigned, but never used:
Texture2D images = Resources.LoadAll(“video”) as Texture2D;
Any help would be appreciated. I’d also favor c# as I am quite terrible with js.
To your response to what Eric5h5 said, that will put them in order alphabetically, or numerically (hint). But you could also use this possibly:
var arwww : WWW[];
var image : Texture2D[]; //Your array of images, set it to the needed length
var location : String; //The folder of all of your images
function Awake(){
arwww = new WWW[image.Length];
for(i = 0; i < image.length; i++){
arwww *= new WWW(location+ "/image"+ i);*
arwww_.LoadImageIntoTexture(image*);
}
}*
I didn’t test that, but I extracted that from a method that i’m using to render texture packs in my game. I hope this helps!_