SkillAgentSearch skills...

UnityConfigFoundation

Automatically generate data objects according to CSV configuration table. Support convert Primitive/1D Array/ValueTuple/Frequently-used UnityEngine Types.

Install / Use

/learn @Mr-sB/UnityConfigFoundation
About this skill

Quality Score

0/100

Supported Platforms

Universal

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.

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

View on GitHub
GitHub Stars4
CategoryCustomer
Updated1y ago
Forks0

Languages

C#

Security Score

75/100

Audited on Aug 16, 2024

No findings