Thanks for all the variations of your answer. Starting to make sense (the reasoning). But increases my general confusion about how it should be used. I need to think about this for a while.
It’s not just tweeners. It is - perhaps a bit overcomplicated, yet very reusable - system for showing any kind of UI frames. There is FrameData base, FrameView base, and data binder - which is an implementation of the way those two are put together. Naturally this lives in the GO world. My UITK implementation is just another inheritor of the abstract FrameView, which creates VisualElement on UIDocument’s RVE and provides this panel to the binder. This way I can display given data very easily in any way - UITK, uGUI, GO hierarchy with SpriteRenderers and TMPs, …
Likewise, the tweeners are modular. They tween properties of the FrameView, they don’t care if it’s UITK or something else. So if I replace the UIDocument FrameView with another type, the tweener still worksSo that’s the reason for living in GO world.
So for each instance of this frame prefab/hierarchy there is a UIDocument component. This is easy to work with in terms of knowing exactly what the instance is dealing with, even if it’s several identical frames displayed on screen, but each is being fed different data. Cards, for example. Just as we are used to - for example - there is no question about which SpriteRenderer your prefab is supposed to be dealing with, other than the one packed and referenced within. Now I’m trying to wrap my head around this hypothetical thought experiment of having a global SpriteRenderer, which all pooled objects should statically reference and manage their “slots” to put sprites into. Can be done, of course, it’s just something new and breaking the well known simplicity.
So if I make one global reference to a single UIDocument, the FrameView will reference it, .Add it’s own elements and provide these to the binder. Then, the coexistence of GO world with UITK world is even weirder, when some object A is pooled, looking at some non-pooled global thing B (UIDoc), to reference/manage/pool some other thing C (VisualElement).
Since I think that the authoring experience is already great (apart from some bugs), I decided to play this game. But soon I hit a mindset roadblock. Now that I want to treat UIDocument as a global thing, it’s Source Asset field stops making sense. It made sense in my use case where I used multiple UIDocuments and used source asset to conveniently set different enclosing containers for various frame types. But having only one UIDocument, there is no use for it, because it’s basically the whole screen where all other VEs will live. This forces me to create an empty container asset to use as the Source Asset, and immediately I think - wait a minute, this surely isn’t the way this was designed to work.
Any guidance here? Thanks a lot!
(btw UITK is awesome and despite these hardships I pushed on and was very rewarded, and while it’s still under development, I’d love to align my mindset to yours so I don’t hit other roadblocks down the road)