This package contains a set of variables based on the ScriptableObjects, which make it great for storing and simply sharing state without tight coupling. Moreover, it provides a way to share variables (state) across multiple scenes making it powerful for multi-scene Unity project.
- ScriptableObject Variables - A set of variables that can be used to store and share state across scenes.
- Simply extend the
VariableBaseSO<T>
class to create your own variable types, see examples in the BoolVariable folder. - Watchable Variables - You can subscribe to
onValueChanged
event to get notified when the value changes.
- Simply extend the
- References - A way to reference variables or inlined values in the Project (changeable in the Inspector).
- You can directly set the value in the Inspector or reference a variable.
- This makes flexible go to choice how to use the variables or inlined values in your scripts.
- Variable Modifiers - Wrapper classes that allow you to modify the value of the variable in a specific way.
- For example, you can use the
BoolModifier
- For example, you can use the
- Variable Aggregations - A set of classes that allow you to aggregate multiple variables into one.
- For example, you can use the
BoolAggregation
to aggregate multiple boolean variables into one.
- For example, you can use the
Install the package using npm scoped registry in Project Settings > Package Manager > Scoped Registries
Unity Docs - Install a UPM package from a Git URL
{
"name": "NPM - xprees",
"url": "https://registry.npmjs.org",
"scopes": [
"cz.xprees",
"com.dbrizov.naughtyattributes"
]
}
Then simply install the package using the Unity Package Manager using the NPM - xprees scope or by the package name cz.xprees.variables
.