ドキュメント

Unity Engine


User Manual

Script Reference

Unity Engine


Work with elements in-scene

Add, reorder, and manage visual elements in the scene.
読み終わるまでの所要時間 2 分最終更新 1ヶ月前

The basic building block in UI Toolkit is a
VisualElement
. Visual elements form a parent-child visual tree. You can add and organize elements directly in the Hierarchy window or in the UI Staging mode.

Add elements

To add an element to a UXML document:
  1. Open the element menu using one of the following methods:
    • In the Hierarchy window or in UI Staging mode, select + > UI Toolkit > Standard Element.
    • In the main menu, go to
      GameObject

      ?

      > UI Toolkit > Standard Element.
  2. Select the element from the list.
    If the element you want isn't in the list, select UI Library to open the UI Library window, then select the element or drag it directly from the UI Library window to the UXML document.
To add a child element to a parent:
  1. Right-click (macOS: Ctrl+click) the parent and select Standard Element > Add Child.
  2. Select the element from the list.
By default, elements have no Name attribute and appear in the Hierarchy window by type. To name an element, in UI Staging mode, double-click it to enter a name or set a name in the
Inspector

?

window. Names identify elements in the UI and don't need to be unique.

Reorder elements

To reorder elements, you can drag one or more elements in the hierarchy or move them between parents:

Reorder in hierarchy

Additional resources