Examples
This page lists a collection of examples that you can build with UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary Toolkit:
Layout
List and tree views
Scroll view
Label
Pop-up window
Toggle
Custom control
Drag-and-drop
Basic binding examples
Topics |
Description |
Bind with binding path in C# script |
Use bindingPath to create a binding that changes the name of a GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info See in Glossary in a custom Editor window. |
Bind without the binding path |
Use BindProperty() to create a binding that changes the name of a GameObject in a custom Editor window. |
Bind with UXML and C# |
Create a binding and set the binding path in UXML, and bind with Bind() in C#. |
Create a binding with the Inspector |
Create a binding that binds among a custom InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info See in Glossary, a custom Editor, and serialized objects. |
Bind to nested properties |
Use the binding-path attribute of a BindableElement in UXML to bind fields to nested properties of a SerializedObject |
Bind to a UXML template |
Create a binding and set binding paths with UXML templates. |
Receive callbacks when a bound property changes |
Creates a custom Editor window with a TextField that binds to the name of a GameObject in a sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info See in Glossary. |
Receive callbacks when any bound properties change |
Create a custom Inspector with two fields that warns the user if the values of the fields fall outside certain ranges. |
Advanced binding examples
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。