- Home /
Is Awake() called before texture loading?
Hi, I want to change my textures dynamically when loading a scene based on the device type(iPhone,iPad, etc.) but I do not want ANY texture to be loaded before knowing WHAT to load.
If not using Awake(), how can I achieve this?
Answer by Kaz_Yamof · Jul 15, 2014 at 11:40 AM
You could try set the script to be executed first. Edit/Project Settings/Script Execution Order See: http://docs.unity3d.com/Manual/class-ScriptExecution.html
Answer by screenname_taken · Jul 15, 2014 at 11:41 AM
Make a tiny empty scene to load first, and have a script in there to set stuff up and as soon as it's done, load the next scene.
But what kind of stuff? The next scene has the wrong textures already. For example: The scene has all textures for iPhone but I am on an iPad and now I want unity to not load the default textures from the scene but the ones I tell it to.
Check in that empty screen if the device is an ipad or an iphone. AFAI$$anonymous$$, the resources get loaded when you load the scene.
Ok, with this I can set a singleton field saying that the device is an iPad, but how to change the textures before the wrong ones are loaded?