You bind custom controls to serialized properties to synchronize values between the control and the property. You can create a bindable custom control derived from the BaseField
generic base class instead of BindableElement
. This provides the following advantages:
INotifyValueChanged
interface for the generic parameter type that you specify.
Note: It’s possible to create custom controls derived from built-in UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary controls if you understand their internal hierarchy and existing USS classes. Unity discourages this practice because your custom controls might be dependent on their internal structure, which is subject to change in the future.
To bind custom controls to data:
INotifyValueChanged
interface and listen for ChangeEvent
s as needed.BindableElement
class or implement the IBindable
interface.Refer to SerializedObject data binding for more details.
For a bindable custom control example, refer to Create a bindable custom control.