Version: 2020.3
UI 工具包
视觉树

Accessing UI Toolkit

You can access UI Toolkit in two ways:

  1. As a core part of the Unity Editor.
  2. As a package (com.unity.ui).

The built-in version for each major Unity release is based on a specific package version.

内置 UI 工具包与 UI 工具包软件包

The built-in version of UI Toolkit includes the features required to make user interfaces for the Unity Editor. The package version contains additional features required to make runtime user interfaces for games and applications.

Both versions of UI Toolkit work the same way, and use the same namespaces: UnityEditor.UIElements and UnityEngine.UIElements. If you install the package, you don’t need to do any additional configuration.

选择 UI 工具包的版本

The decision of what version of UI Toolkit to use depends on the user interfaces you plan to make.

  • To create Editor-only user interfaces, use the built-in version of UI Toolkit.
  • To create runtime and Editor interfaces, install the UI Toolkit package.

Installing the package also gives you access to the latest UI Toolkit features. Unity may release preview versions of the com.unity.ui package between major Unity releases.

注意:
预览版 com.unity.ui 可能包含非稳定或最终的功能。应避免在生产中使用预览版本。

安装 UI 工具包软件包

从 Package Manager 安装 UI 工具包软件包:

1.单击 Add (+) 2. From the menu, choose Add package from git URL… 3. In the text field, type com.unity.ui 4. Click Add

Package Manager 会自动查找并安装 UI 工具包软件包。

UI 工具包
视觉树