UI-based game memory and performance issue.

We’re developing UI-based multi-mode game, we can say each mode represents one type of game. We have one root Canvas and modes are children of it (RectTransforms). When the game starts, we’re creating all modes, then disabling those which aren’t active, so only current active mode’s RectTransform is enabled. As you switch from one mode to another, new active mode becomes enabled and vice versa. Disabled mode is not updated, which is good solution for performance, but it’s still in memory. On slower devices loading takes a lot of time and some of them aren’t able to load it at all. Should I store modes as Prefabs and when mode is selected, should I instantiate the Prefab and add it to the Canvas and when mode is not used anymore just destroy its GameObject? Or do you know some more efficient and effective solution? Any tip will be appreciated.

Hi

You already seem to have a good proposal for dynamically loading / unloading the GUI as needed.
Another option I think off would be to use multiple scenes, one for each mode and load the appropriate scene as needed.

Good luck with your game !

Regards

Koen Matthijs