Hello.
I am new to unity and working on a project.
I have some images in a resources file under Assets , I am trying to get all of these images names and store the names in a Array or a list .which then will let me use each image name to load it or use it later. Does any one have any idea of how to do this?
Thanks.
I personally have not done this. But I would suggest just simply naming the files in some chronological order.
e.g.
your resource files are somefile1, somefile2 …
GameObject[] a = new GameObject[numFiles];
for(int i=0; i<=numFiles; i++){
a[i] = Resources.Load("somefile"+i, typeof(GameObject));
}
Thank you both, i have thought of both methods u mentions.
I need the imgs to have a unique name so i cant go with paranoidx suggestion
but thanks.
element_wsc. I have seen that before but i am not sure how to use it. if you could show me an example i will be grateful
Thanks.
var allTextures = Resources.FindObjectsOfTypeAll( typeof( Texture ) );
foreach( var tex in allTextures )
nameList.Add( tex.name );
untested