What I meant is UXML and USS should be possible to declare everything in game, 2D and 3D, not just UI
Actually, we could see every visual, audio, bounding or any object that could interact with user as the “UI of the game”. The building on the ground that user could touch. A ball that player could drag around. Weapon that user could pick if the character’s hand can reach. Everything could be considered as UI. Especially in a non realtime game that almost all objects is bound to game state, not physics
So it should be possible to serialized every kind of GameObject, additionally to VisualElement
, into UXML and USS property. And so we could bind a game state that need to sync with UI to visual object in game too. Such as, when we select a character, we want to have some effect on target character along with character UI showing character’s information. We could be doing this with UXML and USS, selected character could be defined with USS selector Character:active > selectedEffect
and we might set the color
display:none
or --animator-set-shown:true
(custom property that will trigger the animation boolean value)
What do you think?