Skip to content

Simple & Lightweight solution for creating and loading config assets in Unity projects

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

aka3eka/ConfigAssets

 
 

Repository files navigation

Config Assets

openupm

Simple & Lightweight solution creating and loading config assets for Unity projects

Install

The package is available on the openupm registry. It's recommended to install it via openupm-cli.

openupm add caneva20.config-assets

Or

Use UpmGitExtension

Or

Find Packages/manifest.json in your project and edit it to look like this:

{
  "dependencies": {
    "caneva20.config-assets": "https://github.com/caneva20/ConfigAssets.git#0.2.0-preview.3",
    ...
  },
}

Usage

First create a class and extend from Config<T>

public class MyConfig : Config<MyConfig> {}

Then add as many fields as you need, note that it must be Serializable by Unity for it to save

public class MyConfig : Config<MyConfig> {
    [SerializeField] private string _myString;
    [SerializeField] private bool _myBool = true;

    //This also works
    public int myInt;
}

And lastly, just call YOUR_CLASS_NAME.Instance.YOUR_FIELD

int valueFromConfig = MyConfig.Instance.myInt;

About

Simple & Lightweight solution for creating and loading config assets in Unity projects

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%