I want to create an iPad-App where I show some 360°-renderings of architecture-scenes by using a skybox-component on a camera.
The skybox materials and its textures are located in a “Resources”-folder.
This works fine, but now I have to ensure maximum quality with minimum videomemory.
(I use 6 x 2048/2048 automatic compressed textures per material, 1024/1024 appear unsharp on iPad2).
My problem is, how can I definately unload the textures/material from memory when I switch to another panorama?
Would you change anything in my Cleanup()-function?
function Update () {
if(Input.GetKey(KeyCode.Alpha0)) {
GetComponent(Skybox).material=Resources.Load("Pano1/Pano1",Material);
Cleanup();
}
if(Input.GetKey(KeyCode.Alpha1)) {
GetComponent(Skybox).material=Resources.Load("Pano2/Pano2",Material);
Cleanup();
}
}
function Cleanup(){
Resources.UnloadUnusedAssets();
}
And, is there any way to check if cleaning up really works?
I also read something about cleaned textures leave a gap in memory…