Search Unity

Is there a way to go from InspectorElement to UXML?

Discussion in 'UI Toolkit' started by Ryuuguu, Jun 17, 2019.

  1. Ryuuguu

    Ryuuguu

    Joined:
    Apr 14, 2007
    Posts:
    391
    I know about UxmlFactory that generates an InspectorElement from UMXL, I would like to go the other way. This is mainly for learning UXML now. Having examples of what basic UXML for any MonoBehaviour would handy.
     
  2. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780
    Hello,

    At runtime VisualElement objects do not have a 1 to 1 XML representation so it is not easy to provide this kind of functionality.

    The best I can suggest is to go through the UIElementsDebugger to figure out the hierarchy and the name of elements that you can put down in UXML.

    Hope this helps!