Download

Collecting assets from a folder into an array?

Hi - I’m writing a game where I want to be able to switch textures on an object. I can already do this using a switch but I have to manually make each outcome which is tiresome. I’ve already implemented a system which grabs the transforms of any cameras in the scene into an array which I can then cycle between and it works fine, but I want to do this for textures and also for meshes in a folder.

For example - I might have 30 image textures in a sub folder - I want to collect all of these into an array, then say cycle through these using a key or whatever. I can already do the second part of this, it’s just collecting the assets I can’t do - Any ideas? It would also be great if I could filter the names of these textures at collection time.

Cheers guys.

Dan.