Search Unity

[Extensions] How to UXML for ToolbarMenu entries ?

Discussion in 'Immediate Mode GUI (IMGUI)' started by Aledebarande, Apr 26, 2019.

  1. Aledebarande

    Aledebarande

    Joined:
    Oct 6, 2015
    Posts:
    15
    Hello All !

    I'm playing a bit with the new UiElements UXML / UCSS editor functionalties to build a simple editor window and I'm wondering How is working the editor:ToolbarMenu ? I couldn't find a way to add sub-menu entries as the UXML node couldn't take childrens... I'm a bit lost :p
    How is it possible to do that ?

    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <engine:UXML
    3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4.     xmlns:engine="UnityEngine.UIElements"
    5.     xmlns:editor="UnityEditor.UIElements"
    6.     xmlns:upm="UnityEditor.PackageManager.UI"
    7.  
    8. xsi:noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd"
    9. xsi:schemaLocation="
    10.                        UnityEngine.UIElements ../../UIElementsSchema/UnityEngine.UIElements.xsd
    11.                        UnityEditor.UIElements ../../UIElementsSchema/UnityEditor.UIElements.xsd
    12.                        UnityEditor.PackageManager.UI ../../UIElementsSchema/UnityEditor.PackageManager.UI.xsd
    13.                        UnityEditor.Experimental.GraphView ../../UIElementsSchema/UnityEditor.Experimental.GraphView.xsd
    14. "
    15. >
    16.     <engine:Label text="Hello World! From UXML" />
    17.     <editor:Vector3Field label="test"/>
    18.   <editor:Toolbar name="test">
    19.     <editor:ToolbarMenu text="test" name="testMenu">
    20.       <!-- I Feel that there should be something there but it's not working correctely :'( Heeelllpppp-->
    21.     </editor:ToolbarMenu>
    22.  
    23.     <editor:ToolbarButton text="btn"/>
    24.   </editor:Toolbar>
    25.  
    26. </engine:UXML>


    Thanks in advance !
     
  2. Aledebarande

    Aledebarande

    Joined:
    Oct 6, 2015
    Posts:
    15
    Well... looks like the Extensions[UXML/ucss] system not really finished at this point :p
    I'll have to wait for more polishing before been able to use it :(
     
    Last edited: Apr 27, 2019
  3. Aledebarande

    Aledebarande

    Joined:
    Oct 6, 2015
    Posts:
    15
    ...Are there people using Extensions ?
    What are your feedback ?
    Will Unity pay me for using it ? since using Unity is more and more working for their Qa... freely.
    Nice opportunity, Unity ;)
     
    Last edited: Apr 27, 2019
  4. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780