I read in some references this statement “Loading levels calls Resources.UnloadUnusedAssets”. UnloadUnusedAssets is called before, or after read a new level?
There is some oficial documentation about it?
EDITED: Add more specifc information
In the case of Application.Loadlevel. What exactly happens? I can see some possibilities:
a) Before load new scene: I don’t think so, because it could cause all redundant assets need to be loaded again.
Ex:
Scene1: TexA, TexB
Scene2: TexB, TexC
During the transition of Scene1 to Scene2: TexA and TexB are unloaded, Scene2 is loaded, and TexB and TexC are loaded. You never have more that 2 textures in memory, but you load TexA twice.
b) After load new scene: It will only clean assets that will not be needed anymore after load the new scene.
Ex:
Scene1: TexA, TexB
Scene2: TexB, TexC
During the transition of Scene1 to Scene2: Objects from Scene1 are deleted and Scene2 is loaded, TexC is loaded, after execute the clean up the TexA is unloaded. Simple and efficient, but during the transition you have the sum of two scenes, in the example, you have 3 textures in memory.
c) memory threshold is exceeded: Like b), but it clean up if needed during the load
Ex:
Same as b), but if receive a low memory when try to load TexC, it execute the unload assets first, working like a)
I am asking it because I am trying to tune our app to play nice in IPod4, with is limited memory. And I am having problem during big scene transictions, like game to menu, both use a lot of memory for textures, but different ones. It is not a big problem, it unity3d is sufficient smart, but I would like to understand better for further optimizations.