- Home /
Change 2Dtexture dynamicly?
I want to be able to attach different flags to a user list depending on which country the user has selected. I have a foleder in my project (flags) and every flag have an number/id. The user has a countryid attached and I want to be able to get the flag to the user... Can this be done?
Answer by jmansa · Aug 08, 2012 at 09:04 PM
Well, my issue is this. I have multiple imageurls in an array.
var myImages:texture2D[];
for(thisImg in images){
Debug.Log(thisImg);
}
The Debug.Log output this:
Now, I want to get these images inbto my texture2D array, but not sure how. Please help and thanks in advance :-)
Answer by Sundar · Aug 08, 2012 at 10:53 PM
Try this
int i = 0;
for( thisImg in images ){
var www: WWW = new WWW( thisImg );
yield www;
if( i != images.count; ) myImages[i] = www.texture;
++i;
}
Your answer
Follow this Question
Related Questions
Dynamic Terrain Loading 1 Answer
Dynamic Batching Question 1 Answer
Dynamically Changing the Character Motor Script 1 Answer
Dynamic lights with a raycast 1 Answer
Is it possible to have dynamically building snow on the terrain? 1 Answer