Skip to content

Unity variables package suitable for modular and multi-scene architecture based on ScriptableObjects. Inspired by Ryan Hipple Unity 2017 talk.

License

Notifications You must be signed in to change notification settings

xprees/unity-variables

Repository files navigation

Unity Variables Package - cz.xprees.variables

NPM Version

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.

Features

  • 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.
  • 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.
  • 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.

Installation

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.

About

Unity variables package suitable for modular and multi-scene architecture based on ScriptableObjects. Inspired by Ryan Hipple Unity 2017 talk.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages