In my game menu, each level has a preview image attached, so that from the level select screen, players can see what level they’re about to play. Because there’s colour blind options, I also have 2 other colour blind versions, of each preview, for each level. That’s a lot of images to load.
Initially, I had them all as public variables within a single menu scene, and it wasn’t a problem. But, as the game grew, and I added more levels, I noticed a slight pause, which then became a longer and longer pause, when going from the title screen to the main menu. I believe this was because it was trying to load all of the level previews at once, even though it didn’t need them all yet.
A friend suggested putting them all in the resources folder, which I did, and separated out each menu screen into a prefab, which did improve the speed at which the main menu loaded. However, since then, the game takes noticeably longer to boot, and I think this is the cause. It used to boot very quick.
So, what is the best way to handle this kind of asset management? How can you have a bunch of assets like images, or even sounds, ready to use, but without loading them all into memory and causing slow down, or having the resources folder cause other issues like with boot time?
I pondered using scriptable objects, but I’m not sure if it will cause the same issue that public variables do? How do people get around this? Is there some other way to have them on hand, that’s efficient, and not load them until you need them?
