Tools for UNITY developers

UnioSoft

[ Smart Bindings ]

Bindings are components to link uGUI to data in your objects and apply this data back (in bi-directional mode). More about data binding theory here.
It is very useful to split data model and presentational view one from each other to make your solution much more modular, so programmers and designers can work on same things simultaneously.
Plus this will allow you to build complex graphical user interfaces without coding at all.

Simple Bindings

To illustrate how it works. Let`s do simple setup. Before doing something with bindings you need to be shure that in your scene present Bindings Manager.
1. Create some data source, bindings are able to see fields or properties of any components, better to create your own MonoBehaviour classes.
2. When target is specified you can select any public field or property of this object.
3. Then you need to choose what kind of data visualization you want to have. For string data we can just output it as is to uGUI Text component.
4. (Depends on Kind) Specify what Text component should used as recipient.
Run and see what you will get.

Binding to the Root

Some time binding don`t know to what target it should be binded from start, it only knows what value of this target should be used.
To handle this situation you can use BindingRoot component, which will be an intermediate target for all child Bindings in hierarchy.
BindingRoot
1. Create BindingRoot component on parent GameObject in hierarchy and select as Source Object our Data.
2. Select what exactly in this data we want to use (GameObject it self or one of it`s components).
Binding
1. Inside child binding or root you need to set flag Use Binging Root.
2. Select what field or property should be used for given Data.
3. Choose kind of data visualization.
4. (Depends on Kind) Specify Text component to output values.

 

Set Values via Bindings

If you need to update Data but your hierarchy does not know anything about this data you also can use bindings.
For this purpose each value Binding has method Set(value).

Method Bindings

If you need to execute some method of some object but your hierarchy does not know anything about ut you also can use method bindings.
This kind of bindigns support parameters and can call any public instance method. You can execute this binded method by calling Execute(parameter) method.

Collections

To display dynamic collection of data objects you can use Collection Bindings. To do this you need:
1. Setup Data source.
2. Select Field or Property, which support IEnumerable interface (array, list ...).
3. Specify what prefab (with Binding Root component) should be used to present items if given collection.