Should it be possible to use UIElements for everything?

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?

Add data binding to this and you’ll get another xaml. I don’t know why, but this do not works.

I think UXML already has data binding, isn’t it? Actually I think UXML is already try to be xaml. But what I try to talk about here is, even xaml still mostly a 2D ui. But we could have it work for whole 3D game if it not a real time game

Why you think “this do not works” though?

digging