Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/BastianBlokland/enum-generator-unity
Unity package for generating c# / f# / vb / cil enums based on json input files.
https://github.com/BastianBlokland/enum-generator-unity
enum-generator enumeration json unity upm
Last synced: 3 months ago
JSON representation
Unity package for generating c# / f# / vb / cil enums based on json input files.
- Host: GitHub
- URL: https://github.com/BastianBlokland/enum-generator-unity
- Owner: BastianBlokland
- License: mit
- Created: 2019-07-07T13:02:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-09T12:21:37.000Z (about 5 years ago)
- Last Synced: 2024-04-24T16:42:16.888Z (7 months ago)
- Topics: enum-generator, enumeration, json, unity, upm
- Language: C#
- Homepage:
- Size: 983 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EnumGenerator-Unity
Unity package tool for generating c# / f# / vb / cil enums based on json input files.
## Description
If you have config in json files it can be nice to have a enum to reference in the code instead of
having to hard code values, this tool allows you to generate that enum.## Installation
1. Add a reference to this repository to your package dependencies (`Packages/manifest.json`)```
"dependencies": {
"com.bastianblokland.enumgenerator": "https://github.com/BastianBlokland/enum-generator-unity.git#v1.6.1",
...
}
```
2. Add the NuGet dependency to your project.If your project uses a NuGet package manager you can simply add a dependency to [**EnumGenerator.Core**](https://www.nuget.org/packages/EnumGenerator.Core/) version `4.1.*`.
If you are not using a NuGet package manager you can simply copy the dll's from the [`.lib`](https://github.com/BastianBlokland/enum-generator-unity/tree/master/.lib) directory to your project.
## Usage
1. Create a `Generator` scriptable-object. (Right mouse the project window -> `Create/EnumGenerator/Generator`)
2. In the `Json File` field of the generator configure the file to base your enum on.
3. Configure the jPaths to point to the right fields in your json. (More info: [**readme**](https://github.com/BastianBlokland/enum-generator-dotnet/blob/master/README.md#json-file-structure))
4. In the `Output Path` field of the generator configure where to output the enum to. (Relative to the `Assets` directory)## Example
An example of how to integrate this package with a unity project can be found in the [`.example`](https://github.com/BastianBlokland/enum-generator-unity/tree/master/.example) directory.## Help
More information: [**enum-generator-dotnet**](https://github.com/BastianBlokland/enum-generator-dotnet)