Hey folks. I am building a 2D game where each level the player drives a train from station to station and fights baddies on it on the way. Between any given station, the player can completely change their train’s composition, from a big selection of carriages, weapons, cargo, etc.
I want to take advantage of the performance optimization of sprite sheets, but I really don’t need all the possible sprites the train COULD have loaded into memory for each level - only the ones that are currently being used (since they can’t change their loadout during the level). Since the loadout is up to the player, I can’t make the sprite atlas at build time.
I was hoping I could programatically generate a sprite sheet for each level while the level is loading, based on the player’s current loadout. However, everything I can find about Unity’s sprite packer (Unity - Manual: Sprite Packer) seems to be targeted at build time rather than run time. Could anyone point me in the right direction for dynamically creating sprite sheets at run time?