OK, I’ve been putting this off for a while, but I’d like to figure it out…
I have a 2D game which uses sprites w/ Alpha for all the characters in the scene, which may be quite a few at once and of numerous different types. My pictures folder currently contains about 1,500 images, and I’m about halfway done…
This all runs perfectly fine on a variety of android devices (barring only the CRAPPIEST knockoff I have, which can’t handle the transparency as usual).
That is, everything seems to run fine, once a scene is loaded, however, EVERY TIME I load a new scene (really it’s just back and forth between two scenes), it takes like 20 or 30 seconds.
This is due to the large number of textures. Every time I add another stack to the project, the load time increases. To be clear, I would expect, say, an increased game load time at LAUNCH, when all the textures are first cached. I MIGHT EVEN anticipate a long load in general for my MAIN scene, which actually may involve the sprites in question… But even loading my menu scene takes super long now, and that does not involve any sprites… And, like I said, once my main scene (or any scene) is loaded, there is no performance issue, even though ANY of my prefabs may be instantiated at any time… (meaning all the textures are successfully cached with no apparent lag) So why does changing scenes always take so long?
A bit more on the setup:
Each “character” is a game object with a script which contains several Texture arrays, which are already set with their appropriate textures… These are all prefabs, and are instantiated/destroyed randomly as needed in my main scene, without issue.
Note that, since all my levels are in fact one single scene, I could simply combine it with my menu scene to make the whole game essentially one scene… That would (essentially) solve this issue, but I’d like to understand the real deal… Why is it that more PICTURES in my ASSETS folder equals longer load for EVERY SCENE, EVERY TIME? And, is there a way around this?
(my suspicion is that the resources are maybe being automatically re-loaded (onto the prefabs?), in which case I’m thinking maybe I need to put everything into the Resources folder to avoid this… Or maybe just dynamically create my character templates in-scene so there are no prefabs… But I may be way off… I am about to start a test build to test these (A: is it the prefab connection, or the textures themselves… and B: will Resources provide a solution, or the no-prefab approach, etc), but meanwhile any advice is greatly appreciated!)