Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: breakmachine on September 25, 2013, 07:06:09 AM
-
Hi!
I'm struggling with this problem. I have a game with two scenes, menu and game. When jumping from menu to game the menu-atlas-material remains in memory. I can avoid this by disabling the ngui-root-gameobject before I load game but since I want my ngui loading screen to show while loading I don't want to do that.
I have also tried using DontDestroyOnLoad on the ngui-root-gameobject and then wait for OnLevelWasLoaded in game and then disabling and destroying the ngui-root-gameobject but the profiler still says I have references to menu-atlas-material from the fonts and atlas which I am sure are not used (since the whole thing works if I just disable the menu before loading game).
Got any ideas on how to solve this?
-
Which version of NGUI?
-
I was using 2.6.3 but now that I've updated to 2.7 the problem actually got worse. Now it doesn't even help disabling the ngui root.
-
Upgraded to NGUI 3.0.1 but still the same result I'm afraid.
-
Some pics of what you're seeing, as well as more info such as which device, how you are switching scenes, how you are unloading your atlas and when, etc can all help here. You are unloading the atlas, right? Because if you don't, then it won't just go away by itself.
-
Since I'm loading a new scene with Application.LoadLevel, I don't use DontDestroyOnLoad and I can't find any static references it should be garbage collected shouldn't it? However the texture seems to remain in memory with a reference from the material which is referenced from the atlas prefab.
I have now put the texture and material in a resources folder and use Resources.UnloadAsset on both and that seems to solve the problem. Resources.UnloadUnusedAssets did not work I'm afraid. Also I tried debugging with geometry but there's none after jumping to the next scene.