Search Unity

UIElements uxml nested of template and slot, bug?

Discussion in 'UI Toolkit' started by zhouxing_unity, Jun 23, 2021.

  1. zhouxing_unity

    zhouxing_unity

    Joined:
    Nov 19, 2020
    Posts:
    2
    template.uxml
    <engine:VisualElement slot-name="header" />
    <engine:VisualElement slot-name="content" />

    test.uxml
    <engine:Label text="xxxxxx" />

    index.uxml
    <engine:Template name="test" src="test.uxml">
    <engine:Template name="template" src="template.uxml">
    <engine:Instance template="template">
    <engine:Instance slot="content" template="test" /> <!-- error -->
    </engine:Instance>

    ------------------------------------------
    error: Slot 'content' was not found. Existing slots:
     
  2. zhouxing_unity

    zhouxing_unity

    Joined:
    Nov 19, 2020
    Posts:
    2
    index.uxml
    <engine:Template name="test" src="test.uxml">
    <engine:Template name="template" src="template.uxml">
    <engine:Instance template="template">
    <engine:VisualElement slot="content">
    <engine:Instance template="test" /> <!-- error -->
    </engine:VisualElement>
    </engine:Instance>
     
  3. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    480
    Hi, can you clarify what you are trying to do here?
    Thank you.