Misc

← Back Scriptable objects
Description

Scriptable objects data binding tool allows to inject values from database rows to scriptable objects. Optionally this tool can be executed automatically on database saving. Tool location is "Settings->Data Binding->Scriptable Objects"

How to use the tool
  1. Rows mapping: the scriptable object class should have BGDatabaseEntityId string field. This field is used to find the database row, and the value should be the target row's ID
  2. Fields mappings: the tool use naming convention to map the fields. Scriptable object fields should have the same name and the same type as database fields. In our example both scriptable object and database row have population(int) field. The only exception is database name field, which is mapped to entityName scriptable object field
  3. The tool can be invoked either manually (by clicking on "Inject now" button) or automatically on database saving (by turning "Enable SO injecting on saving" toggle on). The latter option is preferable if you want to keep scriptable objects data in sync with database data without taking any extra actions
  4. After tool execution is complete, you can check the execution log to make sure all data is transferred properly. Enable "Detailed log" toggle for detailed information. The log contains the row's name, the scriptable object name, field names and transferred values.
← Back to Misc