Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mr-sb/unityconfigfoundation
Automatically generate data objects according to CSV configuration table. Support convert Primitive/1D Array/ValueTuple/Frequently-used UnityEngine Types.
https://github.com/mr-sb/unityconfigfoundation
config converter csv foundation script unity
Last synced: 29 days ago
JSON representation
Automatically generate data objects according to CSV configuration table. Support convert Primitive/1D Array/ValueTuple/Frequently-used UnityEngine Types.
- Host: GitHub
- URL: https://github.com/mr-sb/unityconfigfoundation
- Owner: Mr-sB
- License: mit
- Created: 2020-04-13T17:38:37.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-16T07:08:58.000Z (about 2 years ago)
- Last Synced: 2024-11-06T20:37:33.971Z (3 months ago)
- Topics: config, converter, csv, foundation, script, unity
- Language: C#
- Homepage:
- Size: 105 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UnityConfigFoundation
Automatically generate data objects according to CSV configuration table.## Feature
* `TextAssetLoader` can help you easily load `TextAsset` from `StreamAssets` or `Resources` or `PersistentDataPath`.
* `CSVConverter` can convert CSV text to some frequently-used data objects.
* `CVSGenerator` can convert the definition of CSV and Class.
* Support convert Types:| Primitive | 1D Array | List | ValueTuple | Frequently-used UnityEngine Type |
| :-------: | :------: | :--: | :--------: | :------------------------------: |
| √ | √ | √ | √ | √ |## CSV form
* First line are field names.
* Second line are field types.
* Third line are descriptions.
* Others are records.## Extend
If you want to add some data type converter, create a class and use `partial` keyword to be part of `FieldConverter` class.
```c#
namespace GameUtil.Config
{
public static partial class FieldConverter
{
//Must add FieldConverterAttribute to convert method.
//The method must be static, return type can not be void, and parameter is string.
[FieldConverter]
public static DataType Vector4IntConverter(this string fieldContent)
{
//Add convert logic.
}
}
}
```## Plugin
* [TinyCSV](https://github.com/Mr-sB/TinyCSV)(Open source)