2D Toolkit Forum
2D Toolkit => Support => Topic started by: Siddharth3322 on May 25, 2014, 12:11:08 pm
-
I have pretty basic question but answer of this clears my mind very well.
If I have multiple sprite collection and used it for different scene then each get loaded at same time or not?
I don't perform any loading and unloading task. So what is default behaviour of sprite collection?
-
Same as any asset in unity. Unless you retain persistent references in unity, they will be unloaded when the level gets switched. If in doubt check unity docs for rules, sprites follow the same rules as everything else.
-
So if I prepare different sprite collection for each scene then I got benefit that unnecessary collection not get loaded.
Because that sprite collection's sprite not present in screen.
Am I understand right in this?
And one more thing, thanks for your replies and I always get reply from you.
-
Yes thats correct
-
Sorry but I want to ask one more question that I forgot yesterday.
For example, I have one sprite collection of 2048 size for whole game and I have followed scene based approach for developing game.
So each scene use same sprite collection. So loading and unload of this sprite collection happened on each scene change or not??
And if loading and unloading happen on each scene change then I don't want to perform this. I want to keep this sprite collection in memory then what to do for this?
-
you can make it permanently persistent by calling Object.DontDestroyOnLoad
-
I understand what you say.
But I am little surprised after reading above post.
Actually using DontDestroyOnLoad will keep texture in device memory.
Is it true? Please give some explanation about this.
-
Read the unity docs. Thats what its there for.