All fields are supported (Unity asset fields are readonly, more info).
"Unity Visual Scripting" package is available for Unity version >= 2021 via Package manager (installed by default), Bolt is available for Unity 2018-2020 via Asset Store.
After you generated units and used them in your graphs- do not change code generator parameters or rename table/fields- otherwise you can lose their references in existing graphs
List of generated unitsWith custom units you have full control over database data- you can select/add/update/delete rows. Custom units are generated for each table
|1||GetByIndex||Retrieve field values from database by row's index. This is the best method to use inside for-each loop|
|2||GetById||Retrieve field values from database by row's id.|
|3||GetByName||Retrieve field values from database by row's name.|
|4||SetByIndex||Set field values to database by row's index.|
|5||SetById||Set field values to database by row's id.|
|6||SetByName||Set field values to database by row's name.|
|7||Count||Retrieve total number of rows|
|8||Create||Create a new row|
|9||Delete||Delete a row by its index|
How to generate
- Open BGDatabase window
Settingstab, and chose
Visual Scripting (ex-Bolt)
- Fill in parameters and press
- After units was generated, you may need to update units database. If you use Visual Scripting, select Edit->Project Settings->Visual Scripting->Regenerate Units. If you use Bolt, select Tools->Bolt->Build Unit Options
|Code Generator||Class to use for code generation (use default one)|
|Source file||Source file to use for generated C# classes (units). All classes will be put into one single .cs file, which should be under your project folder|
|Package||Package (C# namespace) for generated classes. For example
|Class names prefix||
Prefix to use for each class name.
So if you use
|Field names prefix||Prefix to use for each generated property name. So if you use
|Target platform||The choice between "Unity Visual Scripting" or "Bolt"|
Difference between getters and setters
- Getters are not included into control flow: you can not include them. Values are fetched when requested.
- On the other hand, setters are required to be included into control flow, otherwise they will not be executed
Bolt to VisualScripting package migration guide
This guide is for database units/plugins only
- Re-generate units with VisualScripting platform as a target.
Alternatively, open C# file with generated units for Bolt in your text editor and replace the following lines:
with this line:
using Bolt; using Ludiq;
Save the file.
- If you use any additional Bolt plugins, download and import their VisualScripting versions from download page