- Home /
Setting Material Textures at runtime for the rest of the game
Hey everyone,
I've got a simple problem and I think I'm too tired to figure it out.
I'm working some optimization for a game and I've got my heavy textures high res and low res (iPad/iphone and iPad Retina) and I had the idea of loading these into the appropriate materials at the start of my game.
So my script has an array list of all these materials and the textures that have to be loaded in depending on the device. Now this all works perfectly in Editor, but at runtime on a device these materials get reverted after a scene switch (well they make it one scene switch, but afterwards I've lost them)
Is there a way to set a material texture so the material stays that way for the rest of the application.
I could do this process every scene, but I fear having all these materials and their high res and low res reference in the scene at startup (the script gets destroyed after it's done), will end up costing a lot of performance.
Thank you in advance