ExcelToJson 기능추가
- dll에 해당 기능 추가 및 class 스크립트 생성기능 추가
This commit is contained in:
parent
1cfacdadb5
commit
4df1f6522f
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,6 +10,7 @@
|
|||
/[Bb]uilds/
|
||||
/[Ll]ogs/
|
||||
/[Uu]ser[Ss]ettings/
|
||||
/TableData/
|
||||
|
||||
# MemoryCaptures can get excessive in size.
|
||||
# They also could contain extremely sensitive data
|
||||
|
|
8
Assets/AddressableResources.meta
Normal file
8
Assets/AddressableResources.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ea9a1164bcc6a84994193f2ccd487e9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ea9a1164bcc6a84994193f2ccd487e9
|
||||
guid: 0b0ea77eb9eb2d744beabf5cc6b43a4a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
|
BIN
Assets/FirstVillain/Plugins/ExcelDataReader.DataSet.dll
Normal file
BIN
Assets/FirstVillain/Plugins/ExcelDataReader.DataSet.dll
Normal file
Binary file not shown.
33
Assets/FirstVillain/Plugins/ExcelDataReader.DataSet.dll.meta
Normal file
33
Assets/FirstVillain/Plugins/ExcelDataReader.DataSet.dll.meta
Normal file
|
@ -0,0 +1,33 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a597812ee2145744f8a30f98047c44a8
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/FirstVillain/Plugins/ExcelDataReader.dll
Normal file
BIN
Assets/FirstVillain/Plugins/ExcelDataReader.dll
Normal file
Binary file not shown.
33
Assets/FirstVillain/Plugins/ExcelDataReader.dll.meta
Normal file
33
Assets/FirstVillain/Plugins/ExcelDataReader.dll.meta
Normal file
|
@ -0,0 +1,33 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d0348492a1cc2224aa979c9b92b9ee65
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 10fcc1f254bccda448b5107530e34db0
|
||||
guid: 781f7b14bda3aac42928c2922349f57a
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
|
BIN
Assets/FirstVillain/Plugins/Newtonsoft.Json.dll
Normal file
BIN
Assets/FirstVillain/Plugins/Newtonsoft.Json.dll
Normal file
Binary file not shown.
33
Assets/FirstVillain/Plugins/Newtonsoft.Json.dll.meta
Normal file
33
Assets/FirstVillain/Plugins/Newtonsoft.Json.dll.meta
Normal file
|
@ -0,0 +1,33 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ec8d173e794a1ca4da93514d355acb51
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Entities.meta
Normal file
8
Assets/Scripts/Entities.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a05c41fb53c48884dbc7ac0c18c99f1a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
26
Assets/Scripts/Entities/JPropInfoData.cs
Normal file
26
Assets/Scripts/Entities/JPropInfoData.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FirstVillain.Entities
|
||||
{
|
||||
|
||||
|
||||
public class JPropInfoData
|
||||
{
|
||||
|
||||
public int Id;
|
||||
|
||||
public float Mass;
|
||||
|
||||
public string PrefabName;
|
||||
|
||||
public int Point;
|
||||
}
|
||||
}
|
11
Assets/Scripts/Entities/JPropInfoData.cs.meta
Normal file
11
Assets/Scripts/Entities/JPropInfoData.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b5a775e606fe23a4e94eb74d39ddc144
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Tools.meta
Normal file
8
Assets/Scripts/Tools.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ee8c2675ff3ba2045a2a66c8de1b6d4f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Tools/Editor.meta
Normal file
8
Assets/Scripts/Tools/Editor.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 052f7e13c2aca714baa4c60f7c0f978c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
23
Assets/Scripts/Tools/Editor/MenuCommands.cs
Normal file
23
Assets/Scripts/Tools/Editor/MenuCommands.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using FirstVillain.Converter;
|
||||
using System;
|
||||
using System.CodeDom;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public static class MenuCommands
|
||||
{
|
||||
[MenuItem("Tools/Convert/ExcelToJson", priority = 999)]
|
||||
public static void ConvertExcelToJson()
|
||||
{
|
||||
var tablePath = Application.dataPath.Replace("Assets", "TableData");
|
||||
var jsonPath = Path.Combine(Application.dataPath, "AddressableResources", "Tables");
|
||||
var entityPath = Path.Combine(Application.dataPath, "Scripts", "Entities");
|
||||
|
||||
JsonConverter.ExcelToJsonAndClass(tablePath, jsonPath, entityPath);
|
||||
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Tools/Editor/MenuCommands.cs.meta
Normal file
11
Assets/Scripts/Tools/Editor/MenuCommands.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 10139298af073df49ab28ebb7ef4986c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
39
Assets/Scripts/Tools/TableManager.cs
Normal file
39
Assets/Scripts/Tools/TableManager.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using FirstVillain.Entities;
|
||||
using FirstVillain.Singleton;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
//규칙 : 테이블을 필요할 때마다 로드해서 사용한다.
|
||||
public class TableManager : UnitySingleton<TableManager>
|
||||
{
|
||||
private void LoadTable<T>(E_TABLE table, Action<Wrapper<T>> result)
|
||||
{
|
||||
AddressableManager.Instance.LoadAssetAsync<TextAsset>(table.ToString(), asset => {
|
||||
result(JsonConvert.DeserializeObject<Wrapper<T>>(asset.text));
|
||||
});
|
||||
}
|
||||
|
||||
//테이블별로 테이블 가져오는 함수를 계속 추가해 줘야하는 단점...
|
||||
#region Prop
|
||||
public void GetPropInfoById(E_TABLE table, int id, Action<JPropInfoData> result)
|
||||
{
|
||||
LoadTable<JPropInfoData>(table, loaded =>
|
||||
{
|
||||
var list = loaded.list;
|
||||
result(list.Find(arg => arg.Id == id));
|
||||
});
|
||||
}
|
||||
|
||||
public void GetPropInfoList(E_TABLE table, Action<List<JPropInfoData>> result)
|
||||
{
|
||||
LoadTable<JPropInfoData>(table, loaded =>
|
||||
{
|
||||
result(loaded.list);
|
||||
});
|
||||
}
|
||||
|
||||
#endregion Prop
|
||||
}
|
11
Assets/Scripts/Tools/TableManager.cs.meta
Normal file
11
Assets/Scripts/Tools/TableManager.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5bc6fbba331398242bb897fd80bf8c47
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user