UnityMasterData is a tool that works just on Unity, to provide a workflow of operating master data for developing quickly/serviceability with using "Excel" for your project.
The diagram following here is described how works UnityMasterData.
{
"dependencies": {
"com.tani-shi.unity-excel": "https://github.com/tani-shi/unity-excel.git#1.0.0",
"com.tani-shi.unity-master-data": "https://github.com/tani-shi/unity-master-data.git#1.0.1",
...
}
}
The excel files to be master data must be format as following below.
A | B... | ||
---|---|---|---|
1 | Key Name *1 | Field Name | <= Not allow empty |
2 | Comment | Comment | <= Nullable |
3 | Enum Definition *2 | <= Nullable | |
4 | Key Type *1 | Field Type *2 | <= Not allow empty |
- *1 : Commonly, the key name will be
id
, and also that type will beint
oruint
. - *2 : If the enum definition is non-empty, that field type will be the enum name, then defines automatically in
MasterDataType.cs
.
The sample excel file is here.
Invoke MasterDataClassGenerator.GenerateAllDataScripts
from your project, then generate scripts.
- {0}/MasterData/DAO/Generated/{1}/{2}DAO.cs
- {0}/MasterData/DTO/Generated/{1}/{2}DTO.cs
- {0}/MasterData/VO/Generated/{1}/{2}VO.cs
- {0}/MasterData/Type/Generated/MasterDataType.cs
- {0}/MasterData/Collection/Generated/MasterDataAccessorObjectCollection.cs
- {0}/MasterData/Editor/Exporter/Generated/{1}Exporter.cs
{0} = The specified path you set.
{1} = A name of the specified excel file without the extension.
{2} = A name of the specified sheet of the specified excel file.
Invoke MasterDataExporter.Export
from your project, then export assets.
- {0}/MasterData/{1}/{2}.asset
{0} = The specified path you set.
{1} = A name of the specified excel file without the extension.
{2} = A name of the specified sheet of the specified excel file.
The sample script is here.
The sample script is here.