Hi! I’m having an issue where I want to instantiate visual elements on a UI document through script when the game is started, but I don’t want them to evaporate when I close and reopen the menu. When I disable the UI Document behaviour, all of the stuff I instantiated in OnEnable() on another script goes away and doesn’t come back when I reenable it, of course. Is there a way to get the UI Document “out of the way” and invisible without actually disabling it, preserving the hierarchy changes I made through script? I’m open to hacky workarounds if need be.
I’ve also tried this by using SetEnabled() for the root visual elements of the documents I want to have persistent hierarchies, but this also seems to reset everything.