Binding System 2
  • Welcome
  • Product
    • Binding Values
    • Minimal UI
    • Pinning Fields
    • Extending the System
      • Bind Class
      • Converters
      • Modifiers
        • List of Available Modifiers (WIP)
      • Bind Rerouting
      • Accessor Providers
    • Demo
    • Settings
    • Troubleshooting
      • Errors Visualization
      • Live Debug
      • Path Value Preview
      • Refactoring
      • Bindings Dependencies
    • Reserializer
    • Performance
    • FAQ
    • External Extensions
      • Odin Inspector
    • ‼️Upgrading from Version 1
  • Change log
    • Changes from version 1
  • Third Party Licenses
Powered by GitBook
On this page
  • Data Pipeline
  • Smart Dropdown
  • Bindings Update Points

Was this helpful?

  1. Product

Binding Values

PreviousWelcomeNextMinimal UI

Last updated 3 months ago

Was this helpful?

The Binding System 2 was designed to help you link objects as quick and simple as possible. Most of the fields are bindable out of the box, in most of the scripts, objects, materials and components. If a field is serialized and its drawer includes a BeginProperty call, it can likely be bound. By default, all fields in scripts with standard drawers are bindable, meaning your scripts and third-party scripts using Unity-compliant drawers are fully compatible.

To bind a field, hover over the field and right click on it to reveal a property menu. In this menu, select Enable Binding.

Once the bind control appears on left-hand side of the field, click on it to bound the field.

Once the field is bound, the data pipeline will be seen with some controls to set it up.

This drawer makes it easy to configure bindings within the Inspector. Additionally, the BindingSystem is compatible with the Odin Inspector, a popular Unity extension.

To disable binding for a field, do the process above in reverse: first unbind the field, then right click on the field and select Disable Binding.

Binding fields is non-destructive, meaning the serialization logic of the field is left untouched and all bind related serialization data is serialized in a different place.

This may not be the case when Update in Edit Mode is enabled, in this case the value will be updated and overwritten over its original data.

Data Pipeline

Data Pipeline is handling the data through a set of stages, some of them optional, to deliver it to its destination. The direction of the pipeline depends on selected BindMode value. When "reading" data, the data goes from bind source property to bound field, that is, from right to left. When "writing" on the other hand, the data goes from bound field towards bind source property. By default, the bind mode is set to Read.

The stages are listed below in the image:

Smart Dropdown

The BindingSystem provides a custom-built searchable dropdown menu that simplifies the access and setup of each binding property.

When clicking on path control or any other Bind option button, a custom dropdown, Smart Dropdown, will appear with relevant information or options to choose from. It can handle different types of data controls, such as checkboxes, input fields, buttons, groups, and more.

When selecting a bind path, the custom dropdown lets you select direct entries:

Or compound entries when both the direct entry and its children are valid choices:

Or search a value among the ones present:

Bindings Update Points

Code based bound fields (with Bind<T>) are refreshed in user-code and don't need automatic refreshes.

The system automatically refreshes bound fields to keep them always with the latest available data. The update logic is very fast but it still incurs a small overhead. To avoid wasting performance, the system allows to decide at which point a bound field should be refreshed. There are several predefined points that you can select:

Here are the update points:

  • Editor: will refresh the bound fields during Editor frame update. Enable this point if you need to see the changes without going to Play mode.

  • Update: will refresh the bound fields during Update phase at runtime. This is the default update point.

  • Late Update: will refresh the bound fields during Late Update phase at runtime.

  • Render: (Available from version 2.2.2) will refresh the bound fields just before rendering the frame. This is useful when refreshing fields linked to animations and IK calculations.

  • Fixed Update: will refresh the bound fields during Physics update phase. Useful when dealing with fields linked to physical simulations.

  • On Change: will refresh the bound fields in any of the previous points (except Render and Editor) and only if the source value has changed.

Since version 2.2.2 it is possible to manually refresh a bound field, through Unity Events. Simply select the bound field to update from the available options and it will refresh when the event is raised. This is useful when you want more control over when to refresh the bindings.

When a bound field is selected in the event, a button will appear with the field. Clicking on it will open the bound field popup from where you can do adjustments. Control (or CMD on MacOS) + Clicking will highlight the bound field in the inspector.

Page cover image
Enable Binding for a field
Bind Control on a field
Bound Field
Data Pipeline Read Mode Example
Default view of Smart Dropdown
Direct Values
Compound Values
Search Values
Update points