So i’m making a UI and i was just wondering which of these methods are the best performance-wise.
This is for a top-down diablo-like system with lots of chests to open or other things you might need to open.
- Having all the widgets on the HUD, but hiding the ones that you don’t need.
- Dynamicly creating them when you need them, then removing them from viewport and letting GC do it’s thing. (I’m not even sure exactly how GC handles widgets, do i just remove them from viewport and remove all references to it?)
- Using the Widget component on the actor itself and hiding/showing accordingly.
- Creating them ONLY if they don’t exist, then from that point on hiding and showing them.
What would be the best choice performance-wise, where you might need to frequently open and close widgets? Specially for things like the player’s inventory or their stats, etc.