Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Data binding

Link properties to the controls that modify their values.
Read time 1 minuteLast updated 22 days ago

Data binding synchronizes properties of non-UI objects, such as a string property on a MonoBehaviour, with properties of UI objects, such as the value property of a TextField. A binding refers to the link between the property and the visual control that modifies it. Use bindings to synchronize values between a property and a specific visual element, so you don't need to write event handlers when the value changes in the UI.
UI Toolkit supports two types of data binding systems that you can use to create bindings for the Editor UI and the runtime UI.

Topic

Description

Comparison of the binding systemsCompares the runtime binding and the SerializedObject data binding.
Runtime data bindingBinds the properties of any plain C#
object
to the properties of a UI control. You can use this type of data binding in the runtime UI. You can also use it in the Editor UI as long as it's not for serialized data.
SerializedObject data bindingBinds the properties of a
SerializedObject
to the properties of a UI control. You can use this type of data binding only in the Editor UI.

Additional resources