Variables - GhooTS/GTScriptableVariable GitHub Wiki

Variables

Variables are wrappers for any type of data (preferable value type), the purpose of Variables is to decouple data from system, so other systems can access this data without need to know the source of the data. All Variables derived from scriptable object.

Event Variables are like normal variable with addition option for raising game event whenever variable is changed through SetValue method.

use Reference Varaible as a field whenever you don't know whether the class should use variable or constant.

use ReadOnly Variable as a field whenever you need access the value of Variable, but you don't want to change it.

By default there are 4 different variables for int, float, bool and string. That include Variable, Event Variable, Reference Variable, and Readonly Variable for those types.

You can create more variable types with Class Creator or from code.

Creating variables and event variables

All Variables and Event Variables can be create from project context menu

Variables path : Create > ScriptableVars > Vars

Event variables path : Create > ScriptableVars > EventVars