Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: kfboelter on August 22, 2013, 09:12:39 AM
-
Hello everyone.
So.. I don't see much about using NGUI for background images, taht should cover the whole device screen.. something like a title screen.
How is that? What is the correct way? Should I use Resources.Load for that, in order to have it dynamically in and out of memory? Or should I use it just as a plain Texture on NGUI? What is best?
Regards
-
You can have a UITexture with UIStretch on it set to cover the entire screen, Resources.Load its texture, unload it afterwards. Just note that when you unload, you need to first set the UITexture's texture to null, then wait until end of frame before unloading the resource.
-
Ah, it is kind of a mix, then :)
Awesome.
-
If you just destroy the game object that was loaded and attached to the Root by AddChild, will that free up the memory also?
-
Nope. But if you have all references to that removed, then you can call Resources.UnloadUnusedAssets() and it will be freed up. I think there's a direct UnloadAsset as well ( http://docs.unity3d.com/Documentation/ScriptReference/Resources.UnloadAsset.html ) but to be honest, I haven't tried it much so I dunno how that works.