2D Toolkit Forum
2D Toolkit => Support => Topic started by: kenshin on December 26, 2013, 09:19:47 pm
-
Hi,
My sprites are too big. As I know sprite collections are on the memory by default. So:
1. At the start of scene, I want to choose my sprite collections on memory. How can I manage those selected collections to be on the memory ?
2. At the end of the scene, How can I remove them from memory ?
if you can give me 2dtoolkit functions and examples, I will be very happy.
3. just roughly, how many sprite collections (2 mb in size), can be active or run on memory for iphone 4 for example ?
4. and maximum draw call count for it? for example, after 15 draw can I live performance problem ? what is best practice count for it not to exceed? just roughly and guide with your experience pls.
-
Sprite collections are only in memory if you refer to them, i.e. have sprites using them in the scene, a link to a tk2dSpriteCollectionData object, etc.
1. You can't choose those unless you want to use Resources.Load to load them. This is kinda counterintuitive doing it that way in Unity, as you won't be able to set stuff up visually. You'd be better off creating multiple scenes and loading them additively if you can. That way, you can set stuff up visually, AND load what you need in.
2. Delete all references to them, then call Resources.UnloadUnusedAssets.
These aren't specific ways to load 2dtoolkit sprites, etc, but pretty much the way you'd do anything like this in Unity.
3. I've never done a stress test.
4. No magic number, it depends very much on how strained your CPU is. If your game isn't CPU bound, you can have 100+ draw calls easily.
-
Thank you very much for answers, and also fast response...