🔹Bool Var
BoolVar and BoolReference values
Last updated
BoolVar and BoolReference values
Last updated
Bool variables are Scriptable Assets that contain a bool value. They can be referenced in any script and be shared around in a project.
To declare a Bool Var use this code. Make sure to have the namespace:
using MalbersAnimations.Scriptables;
This is how it looks in the Inspector:
There is a better way to use the scriptable variables. Instead of using BoolVar
class, use BoolReference
instead:
This is how it looks in the Inspector:
That way you have the option to use a local value or a Scriptable (global) value.
Sharing scriptable variables is an extremely useful tool to have shared values between scripts.
The actual value of the scriptable variable.
When enabled, the console will print a log every time the scriptable variable changes its value
Developer description to give a better explanation of what the variable does.
Scriptable Variables can be listened to using the OnValue changed action.
This is the way of using it via script: