- Home /
How to load and switch between (800+) sprites efficiently
I am making a game with 250+ characters that have two animations: idle and attack. There are some 800+ frames for all the animations. In the game you can have only 5 characters out at any time.
Here is the problem I am having. I want to be able to seamlessly switch between the characters but I am not sure what the best way to do it is. So I guess my question is, what is the best way to load a large number of assets quickly?
Right now, I load the frames of the new sprite via Resources.LoadAll<Sprite>
then replace the current sprites frames with the new frames. The problem is that there is a major hiccup in performance when I load the frames.
I suppose another option could be to load all the characters' frames at the beginning and store them in an array, then access that array when I need to switch the character. I feel like that would cause memory issues.
Is there a better way to load lots of assets?