Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Feature Request Should it be possible to use UIElements for everything?

Discussion in 'UIElements' started by Thaina, Aug 6, 2019.

  1. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    240
    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 3D building on the ground that user could touch to invoke popup. A ball that player could drag around. Weapon that user could pick if the character's hand can reach so it would be highlighted. 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 in addition 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?
     
    uDamian likes this.