Przeglądaj źródła

增加excel导表工具,可以导成json

tanghai 8 lat temu
rodzic
commit
c28977c293

+ 1 - 0
.gitignore

@@ -37,3 +37,4 @@ _ReSharper.CSharp/
 /Server/.vs/
 /Unity/.vs/
 /Tools/MongoDB
+/Excel/md5.txt

BIN
Excel/UnitConfig.xlsx


+ 3 - 0
Unity/Assets/Editor/ExcelExporterEditor.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 8e91244514194e95aac3947b3ff064f4
+timeCreated: 1505439981

+ 337 - 0
Unity/Assets/Editor/ExcelExporterEditor/ExcelExporterEditor.cs

@@ -0,0 +1,337 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using Model;
+using MongoDB.Bson;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using UnityEditor;
+using UnityEngine;
+
+public struct CellInfo
+{
+	public string Type;
+	public string Name;
+	public string Desc;
+}
+
+public class ExcelMD5Info
+{
+	public Dictionary<string, string> fileMD5 = new Dictionary<string, string>();
+
+	public string Get(string fileName)
+	{
+		string md5 = "";
+		this.fileMD5.TryGetValue(fileName, out md5);
+		return md5;
+	}
+
+	public void Add(string fileName, string md5)
+	{
+		this.fileMD5[fileName] = md5;
+	}
+}
+
+public class ExcelExporterEditor : EditorWindow
+{
+	[MenuItem("Tools/导出配置")]
+	private static void ShowWindow()
+	{
+		GetWindow(typeof(ExcelExporterEditor));
+	}
+
+	private const string ExcelPath = @"..\Excel";
+
+	private bool isClient;
+
+	private ExcelMD5Info md5Info;
+	
+	// Update is called once per frame
+	private void OnGUI()
+	{
+		try
+		{
+			const string clientPath = @".\Assets\Res\Config";
+
+			string serverPath = EditorPrefs.GetString("serverPath");
+			serverPath = EditorGUILayout.TextField("服务端配置路径:", serverPath);
+			EditorPrefs.SetString("serverPath", serverPath);
+
+			if (GUILayout.Button("导出客户端配置"))
+			{
+				this.isClient = true;
+				ExportAll(clientPath);
+			}
+
+			if (GUILayout.Button("导出服务端配置"))
+			{
+				this.isClient = false;
+				if (serverPath == "")
+				{
+					Log.Error("请输入服务端配置路径!");
+					return;
+				}
+				ExportAll(serverPath);
+			}
+
+			if (GUILayout.Button("生成配置类"))
+			{
+				ExportAllClass(@".\Assets\Scripts\Entity\Config");
+			}
+		}
+		catch (Exception e)
+		{
+			Log.Error(e.ToString());
+		}
+	}
+
+	private void ExportAllClass(string exportDir)
+	{
+		foreach (string filePath in Directory.GetFiles(ExcelPath))
+		{
+			if (Path.GetExtension(filePath) != ".xlsx")
+			{
+				continue;
+			}
+			if (Path.GetFileName(filePath).StartsWith("~"))
+			{
+				continue;
+			}
+
+			ExportClass(filePath, exportDir);
+		}
+		Log.Debug("生成类完成!");
+		AssetDatabase.Refresh();
+	}
+
+	private void ExportClass(string fileName, string exportDir)
+	{
+		XSSFWorkbook xssfWorkbook;
+		using (FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
+		{
+			xssfWorkbook = new XSSFWorkbook(file);
+		}
+
+		string protoName = Path.GetFileNameWithoutExtension(fileName);
+		Log.Info($"{protoName}生成class开始");
+		string exportPath = Path.Combine(exportDir, $"{protoName}.cs");
+		using (FileStream txt = new FileStream(exportPath, FileMode.Create))
+		using (StreamWriter sw = new StreamWriter(txt))
+		{
+			StringBuilder sb = new StringBuilder();
+			ISheet sheet = xssfWorkbook.GetSheetAt(0);
+			sb.Append("namespace Model\n{\n");
+
+			sb.Append("\t[Config(AppType.Client)]\n");
+			sb.Append($"\tpublic partial class {protoName}Category : ACategory<{protoName}>\n");
+			sb.Append("\t{}\n\n");
+
+			sb.Append($"\tpublic class {protoName}: AConfig\n");
+			sb.Append("\t{\n");
+
+			int cellCount = sheet.GetRow(3).LastCellNum;
+			
+			for (int i = 2; i < cellCount; i++)
+			{
+				string fieldDesc = GetCellString(sheet, 2, i);
+
+				if (fieldDesc.StartsWith("#"))
+				{
+					continue;
+				}
+
+				// s开头表示这个字段是服务端专用
+				if (fieldDesc.StartsWith("s") && this.isClient)
+				{
+					continue;
+				}
+				
+				string fieldName = GetCellString(sheet, 3, i);
+
+				if (fieldName == "Id")
+				{
+					continue;
+				}
+
+				string fieldType = GetCellString(sheet, 4, i);
+				if (fieldType == "" || fieldName == "")
+				{
+					continue;
+				}
+
+				sb.Append($"\t\tpublic {fieldType} {fieldName};\n");
+			}
+
+			sb.Append("\t}\n");
+			sb.Append("}\n");
+
+			sw.Write(sb.ToString());
+		}
+	}
+
+
+	private void ExportAll(string exportDir)
+	{
+		string md5File = Path.Combine(ExcelPath, "md5.txt");
+		if (!File.Exists(md5File))
+		{
+			this.md5Info = new ExcelMD5Info();
+		}
+		else
+		{
+			this.md5Info = MongoHelper.FromJson<ExcelMD5Info>(File.ReadAllText(md5File));
+		}
+
+		foreach (string filePath in Directory.GetFiles(ExcelPath))
+		{
+			if (Path.GetExtension(filePath) != ".xlsx")
+			{
+				continue;
+			}
+			if (Path.GetFileName(filePath).StartsWith("~"))
+			{
+				continue;
+			}
+			string fileName = Path.GetFileName(filePath);
+			string oldMD5 = this.md5Info.Get(fileName);
+			string md5 = MD5Helper.FileMD5(filePath);
+			this.md5Info.Add(fileName, md5);
+			if (md5 == oldMD5)
+			{
+				continue;
+			}
+
+			Export(filePath, exportDir);
+		}
+
+		File.WriteAllText(md5File, this.md5Info.ToJson());
+
+		Log.Info("所有表导表完成");
+		AssetDatabase.Refresh();
+	}
+
+	private void Export(string fileName, string exportDir)
+	{
+		XSSFWorkbook xssfWorkbook;
+		using (FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
+		{
+			xssfWorkbook = new XSSFWorkbook(file);
+		}
+		string protoName = Path.GetFileNameWithoutExtension(fileName);
+		Log.Info($"{protoName}导表开始");
+		string exportPath = Path.Combine(exportDir, $"{protoName}.txt");
+		using (FileStream txt = new FileStream(exportPath, FileMode.Create))
+		using (StreamWriter sw = new StreamWriter(txt))
+		{
+			for (int i = 0; i < xssfWorkbook.NumberOfSheets; ++i)
+			{
+				ISheet sheet = xssfWorkbook.GetSheetAt(i);
+				ExportSheet(sheet, sw);
+			}
+		}
+		Log.Info($"{protoName}导表完成");
+	}
+
+	private void ExportSheet(ISheet sheet, StreamWriter sw)
+	{
+		int cellCount = sheet.GetRow(3).LastCellNum;
+
+		CellInfo[] cellInfos = new CellInfo[cellCount];
+
+		for (int i = 2; i < cellCount; i++)
+		{
+			string fieldDesc = GetCellString(sheet, 2, i);
+			string fieldName = GetCellString(sheet, 3, i);
+			string fieldType = GetCellString(sheet, 4, i);
+			cellInfos[i] = new CellInfo() { Name = fieldName, Type = fieldType, Desc = fieldDesc };
+		}
+		
+		for (int i = 5; i <= sheet.LastRowNum; ++i)
+		{
+			if (GetCellString(sheet, i, 2) == "")
+			{
+				continue;
+			}
+			StringBuilder sb = new StringBuilder();
+			sb.Append("{");
+			IRow row = sheet.GetRow(i);
+			for (int j = 2; j < cellCount; ++j)
+			{
+				string desc = cellInfos[j].Desc.ToLower();
+				if (desc.StartsWith("#"))
+				{
+					continue;
+				}
+
+				// s开头表示这个字段是服务端专用
+				if (desc.StartsWith("s") && this.isClient)
+				{
+					continue;
+				}
+
+				// c开头表示这个字段是客户端专用
+				if (desc.StartsWith("c") && !this.isClient)
+				{
+					continue;
+				}
+
+				string fieldValue = GetCellString(row, j);
+				if (fieldValue == "")
+				{
+					throw new Exception($"sheet: {sheet.SheetName} 中有空白字段 {i},{j}");
+				}
+
+				if (j > 2)
+				{
+					sb.Append(",");
+				}
+
+				string fieldName = cellInfos[j].Name;
+				string fieldType = cellInfos[j].Type;
+				sb.Append($"\"{fieldName}\":{Convert(fieldType, fieldValue)}");
+			}
+			sb.Append("}");
+			sw.WriteLine(sb.ToString());
+		}
+	}
+
+	private static string Convert(string type, string value)
+	{
+		switch (type)
+		{
+			case "int[]":
+			case "int32[]":
+			case "long[]":
+				return $"[{value}]";
+			case "string[]":
+				return $"[{value}]";
+			case "int":
+			case "int32":
+			case "int64":
+			case "long":
+			case "float":
+			case "double":
+				return value;
+			case "string":
+				return $"\"{value}\"";
+			default:
+				throw new Exception($"不支持此类型: {type}");
+		}
+	}
+
+	private static string GetCellString(ISheet sheet, int i, int j)
+	{
+		return sheet.GetRow(i)?.GetCell(j)?.ToString() ?? "";
+	}
+
+	private static string GetCellString(IRow row, int i)
+	{
+		return row?.GetCell(i)?.ToString() ?? "";
+	}
+
+	private static string GetCellString(ICell cell)
+	{
+		return cell?.ToString() ?? "";
+	}
+}

+ 3 - 0
Unity/Assets/Editor/ExcelExporterEditor/ExcelExporterEditor.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 74e20be85f3f4863aa8418d99b14fbbe
+timeCreated: 1505439974

+ 9 - 0
Unity/Assets/Plugins/npoi.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: c3fa93194f02ebe49a7670d67b2f8b8e
+folderAsset: yes
+timeCreated: 1505439286
+licenseType: Free
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Assets/Plugins/npoi/NPOI.OOXML.dll


+ 121 - 0
Unity/Assets/Plugins/npoi/NPOI.OOXML.dll.meta

@@ -0,0 +1,121 @@
+fileFormatVersion: 2
+guid: ddd506206ad91a24499d39bbb41402c9
+timeCreated: 1499162000
+licenseType: Free
+PluginImporter:
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  isPreloaded: 0
+  isOverridable: 0
+  platformData:
+    data:
+      first:
+        '': Any
+      second:
+        enabled: 0
+        settings:
+          Exclude Editor: 0
+          Exclude Linux: 1
+          Exclude Linux64: 1
+          Exclude LinuxUniversal: 1
+          Exclude OSXIntel: 1
+          Exclude OSXIntel64: 1
+          Exclude OSXUniversal: 1
+          Exclude Win: 1
+          Exclude Win64: 1
+    data:
+      first:
+        Any: 
+      second:
+        enabled: 0
+        settings: {}
+    data:
+      first:
+        Editor: Editor
+      second:
+        enabled: 1
+        settings:
+          CPU: AnyCPU
+          DefaultValueInitialized: true
+          OS: AnyOS
+    data:
+      first:
+        Facebook: Win
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Facebook: Win64
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: Linux
+      second:
+        enabled: 0
+        settings:
+          CPU: x86
+    data:
+      first:
+        Standalone: Linux64
+      second:
+        enabled: 0
+        settings:
+          CPU: x86_64
+    data:
+      first:
+        Standalone: LinuxUniversal
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: OSXIntel
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: OSXIntel64
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: OSXUniversal
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: Win
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: Win64
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Windows Store Apps: WindowsStoreApps
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Assets/Plugins/npoi/NPOI.OpenXml4Net.dll


+ 121 - 0
Unity/Assets/Plugins/npoi/NPOI.OpenXml4Net.dll.meta

@@ -0,0 +1,121 @@
+fileFormatVersion: 2
+guid: 23aa2f3505ec6644f9821d9428b28430
+timeCreated: 1499220036
+licenseType: Free
+PluginImporter:
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  isPreloaded: 0
+  isOverridable: 0
+  platformData:
+    data:
+      first:
+        '': Any
+      second:
+        enabled: 0
+        settings:
+          Exclude Editor: 0
+          Exclude Linux: 1
+          Exclude Linux64: 1
+          Exclude LinuxUniversal: 1
+          Exclude OSXIntel: 1
+          Exclude OSXIntel64: 1
+          Exclude OSXUniversal: 1
+          Exclude Win: 1
+          Exclude Win64: 1
+    data:
+      first:
+        Any: 
+      second:
+        enabled: 0
+        settings: {}
+    data:
+      first:
+        Editor: Editor
+      second:
+        enabled: 1
+        settings:
+          CPU: AnyCPU
+          DefaultValueInitialized: true
+          OS: AnyOS
+    data:
+      first:
+        Facebook: Win
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Facebook: Win64
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: Linux
+      second:
+        enabled: 0
+        settings:
+          CPU: x86
+    data:
+      first:
+        Standalone: Linux64
+      second:
+        enabled: 0
+        settings:
+          CPU: x86_64
+    data:
+      first:
+        Standalone: LinuxUniversal
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: OSXIntel
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: OSXIntel64
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: OSXUniversal
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: Win
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: Win64
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Windows Store Apps: WindowsStoreApps
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Assets/Plugins/npoi/NPOI.OpenXmlFormats.dll


+ 121 - 0
Unity/Assets/Plugins/npoi/NPOI.OpenXmlFormats.dll.meta

@@ -0,0 +1,121 @@
+fileFormatVersion: 2
+guid: bec6b1709aaee2d40b287de2251fd62d
+timeCreated: 1499220037
+licenseType: Free
+PluginImporter:
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  isPreloaded: 0
+  isOverridable: 0
+  platformData:
+    data:
+      first:
+        '': Any
+      second:
+        enabled: 0
+        settings:
+          Exclude Editor: 0
+          Exclude Linux: 1
+          Exclude Linux64: 1
+          Exclude LinuxUniversal: 1
+          Exclude OSXIntel: 1
+          Exclude OSXIntel64: 1
+          Exclude OSXUniversal: 1
+          Exclude Win: 1
+          Exclude Win64: 1
+    data:
+      first:
+        Any: 
+      second:
+        enabled: 0
+        settings: {}
+    data:
+      first:
+        Editor: Editor
+      second:
+        enabled: 1
+        settings:
+          CPU: AnyCPU
+          DefaultValueInitialized: true
+          OS: AnyOS
+    data:
+      first:
+        Facebook: Win
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Facebook: Win64
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: Linux
+      second:
+        enabled: 0
+        settings:
+          CPU: x86
+    data:
+      first:
+        Standalone: Linux64
+      second:
+        enabled: 0
+        settings:
+          CPU: x86_64
+    data:
+      first:
+        Standalone: LinuxUniversal
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: OSXIntel
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: OSXIntel64
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: OSXUniversal
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: Win
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Standalone: Win64
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+    data:
+      first:
+        Windows Store Apps: WindowsStoreApps
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Assets/Plugins/npoi/NPOI.dll


+ 121 - 0
Unity/Assets/Plugins/npoi/NPOI.dll.meta

@@ -0,0 +1,121 @@
+fileFormatVersion: 2
+guid: c753a6199062e744c9324a5b053bb4e4
+timeCreated: 1499161999
+licenseType: Free
+PluginImporter:
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  isPreloaded: 0
+  isOverridable: 0
+  platformData:
+    data:
+      first:
+        '': Any
+      second:
+        enabled: 0
+        settings:
+          Exclude Editor: 0
+          Exclude Linux: 1
+          Exclude Linux64: 1
+          Exclude LinuxUniversal: 1
+          Exclude OSXIntel: 1
+          Exclude OSXIntel64: 1
+          Exclude OSXUniversal: 1
+          Exclude Win: 1
+          Exclude Win64: 1
+    data:
+      first:
+        Any: 
+      second:
+        enabled: 0
+        settings: {}
+    data:
+      first:
+        Editor: Editor
+      second:
+        enabled: 1
+        settings:
+          CPU: AnyCPU
+          DefaultValueInitialized: true
+          OS: AnyOS
+    data:
+      first:
+        Facebook: Win
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Facebook: Win64
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: Linux
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: Linux64
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: LinuxUniversal
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: OSXIntel
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: OSXIntel64
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: OSXUniversal
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: Win
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Standalone: Win64
+      second:
+        enabled: 0
+        settings:
+          CPU: None
+    data:
+      first:
+        Windows Store Apps: WindowsStoreApps
+      second:
+        enabled: 0
+        settings:
+          CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 0
Unity/Assets/Res/Config/UnitConfig.txt

@@ -0,0 +1 @@
+{"Id":1001,"Name":"米克尔","Desc":"带有强力攻击技能","Position":1,"Height":178,"Weight":68}

+ 8 - 0
Unity/Assets/Res/Config/UnitConfig.txt.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c245c7dda13b3ad43b2278925e922899
+timeCreated: 1505441234
+licenseType: Free
+TextScriptImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 0
Unity/Assets/Scripts/Entity/Config.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: abb2f46490234e2b9c85fce15f369485
+timeCreated: 1505441031

+ 1 - 1
Unity/Assets/Scripts/Component/Config/BuffConfig.cs → Unity/Assets/Scripts/Entity/Config/BuffConfig.cs

@@ -14,7 +14,7 @@
 		}
 	}
 
-	[Config(AppType.Client | AppType.Gate)]
+	[Config(AppType.Client)]
 	public class BuffCategory: ACategory<BuffConfig>
 	{
 	}

+ 0 - 0
Unity/Assets/Scripts/Component/Config/BuffConfig.cs.meta → Unity/Assets/Scripts/Entity/Config/BuffConfig.cs.meta


+ 15 - 0
Unity/Assets/Scripts/Entity/Config/UnitConfig.cs

@@ -0,0 +1,15 @@
+namespace Model
+{
+	[Config(AppType.Client)]
+	public partial class UnitConfigCategory : ACategory<UnitConfig>
+	{}
+
+	public class UnitConfig: AConfig
+	{
+		public string Name;
+		public string Desc;
+		public int Position;
+		public int Height;
+		public int Weight;
+	}
+}

+ 12 - 0
Unity/Assets/Scripts/Entity/Config/UnitConfig.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: bab6c7de3c7c1d940bf6eb1d0e8506f2
+timeCreated: 1505441063
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 14 - 0
Unity/Unity.Editor.csproj

@@ -122,6 +122,18 @@
     <Reference Include="ICSharpCode.SharpZipLib">
       <HintPath>Assets\Plugins\ICSharpCode.SharpZipLib.dll</HintPath>
     </Reference>
+    <Reference Include="NPOI.OpenXml4Net">
+      <HintPath>Assets\Plugins\npoi\NPOI.OpenXml4Net.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OpenXmlFormats">
+      <HintPath>Assets\Plugins\npoi\NPOI.OpenXmlFormats.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI">
+      <HintPath>Assets\Plugins\npoi\NPOI.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OOXML">
+      <HintPath>Assets\Plugins\npoi\NPOI.OOXML.dll</HintPath>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="Unity.Plugins.csproj">
@@ -169,6 +181,7 @@
     <Compile Include="Assets\Editor\BehaviorTreeEditor\NodeMetaHelper.cs" />
     <Compile Include="Assets\Editor\BehaviorTreeEditor\PropertyDesigner.cs" />
     <Compile Include="Assets\Editor\BuildEditor\BuildEditor.cs" />
+    <Compile Include="Assets\Editor\ExcelExporterEditor\ExcelExporterEditor.cs" />
     <Compile Include="Assets\Editor\ExportNavmesh.cs" />
     <Compile Include="Assets\Editor\ReferenceCollectorEditor\ReferenceCollectorEditor.cs" />
     <Compile Include="Assets\Editor\RsyncEditor\RsyncConfig.cs" />
@@ -181,6 +194,7 @@
     <None Include="Assets\JsonDotNet\Assemblies\Windows\Newtonsoft.Json.XML" />
     <None Include="Assets\JsonDotNet\link.xml" />
     <None Include="Assets\Res\Config\BuffConfig.txt" />
+    <None Include="Assets\Res\Config\UnitConfig.txt" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />

+ 13 - 0
Unity/Unity.Plugins.csproj

@@ -80,6 +80,18 @@
     <Reference Include="ICSharpCode.SharpZipLib">
       <HintPath>Assets\Plugins\ICSharpCode.SharpZipLib.dll</HintPath>
     </Reference>
+    <Reference Include="NPOI.OpenXml4Net">
+      <HintPath>Assets\Plugins\npoi\NPOI.OpenXml4Net.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OpenXmlFormats">
+      <HintPath>Assets\Plugins\npoi\NPOI.OpenXmlFormats.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI">
+      <HintPath>Assets\Plugins\npoi\NPOI.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OOXML">
+      <HintPath>Assets\Plugins\npoi\NPOI.OOXML.dll</HintPath>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Assets\Plugins\MongoDB\MongoDB.Bson\BsonConstants.cs" />
@@ -502,6 +514,7 @@
     <None Include="Assets\JsonDotNet\Assemblies\Windows\Newtonsoft.Json.XML" />
     <None Include="Assets\JsonDotNet\link.xml" />
     <None Include="Assets\Res\Config\BuffConfig.txt" />
+    <None Include="Assets\Res\Config\UnitConfig.txt" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />

+ 20 - 9
Unity/Unity.csproj

@@ -12,15 +12,12 @@
     <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
-    <TargetFrameworkProfile>
-    </TargetFrameworkProfile>
-    <CompilerResponseFile>
-    </CompilerResponseFile>
+    <TargetFrameworkProfile></TargetFrameworkProfile>
+    <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectType>Game:1</UnityProjectType>
     <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.1.0p5</UnityVersion>
-    <RootNamespace>
-    </RootNamespace>
+    <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -83,6 +80,18 @@
     <Reference Include="ICSharpCode.SharpZipLib">
       <HintPath>Assets\Plugins\ICSharpCode.SharpZipLib.dll</HintPath>
     </Reference>
+    <Reference Include="NPOI.OpenXml4Net">
+      <HintPath>Assets\Plugins\npoi\NPOI.OpenXml4Net.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OpenXmlFormats">
+      <HintPath>Assets\Plugins\npoi\NPOI.OpenXmlFormats.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI">
+      <HintPath>Assets\Plugins\npoi\NPOI.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OOXML">
+      <HintPath>Assets\Plugins\npoi\NPOI.OOXML.dll</HintPath>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="Unity.Plugins.csproj">
@@ -397,6 +406,7 @@
     <Compile Include="Assets\Scripts\Base\Config\ConfigHelper.cs" />
     <Compile Include="Assets\Scripts\Base\Config\ICategory.cs" />
     <Compile Include="Assets\Scripts\Base\DoubleMap.cs" />
+    <Compile Include="Assets\Scripts\Base\EQueue.cs" />
     <Compile Include="Assets\Scripts\Base\Event\AEventAttribute.cs" />
     <Compile Include="Assets\Scripts\Base\Event\CrossEventAttribute.cs" />
     <Compile Include="Assets\Scripts\Base\Event\CrossIdType.cs" />
@@ -477,7 +487,6 @@
     <Compile Include="Assets\Scripts\Base\Object\Object.cs" />
     <Compile Include="Assets\Scripts\Base\Object\ObjectEventAttribute.cs" />
     <Compile Include="Assets\Scripts\Base\Object\ObjectEvents.cs" />
-    <Compile Include="Assets\Scripts\Base\EQueue.cs" />
     <Compile Include="Assets\Scripts\Base\QueueDictionary.cs" />
     <Compile Include="Assets\Scripts\Base\TryLocker.cs" />
     <Compile Include="Assets\Scripts\Base\UI\LayerNames.cs" />
@@ -491,7 +500,6 @@
     <Compile Include="Assets\Scripts\BehaviorTreeNode\True.cs" />
     <Compile Include="Assets\Scripts\BehaviorTreeNode\UIScale.cs" />
     <Compile Include="Assets\Scripts\Component\BehaviorTreeComponent.cs" />
-    <Compile Include="Assets\Scripts\Component\Config\BuffConfig.cs" />
     <Compile Include="Assets\Scripts\Component\Config\ClientConfig.cs" />
     <Compile Include="Assets\Scripts\Component\Config\DBConfig.cs" />
     <Compile Include="Assets\Scripts\Component\Config\HttpConfig.cs" />
@@ -510,6 +518,8 @@
     <Compile Include="Assets\Scripts\Component\ResourcesComponent.cs" />
     <Compile Include="Assets\Scripts\Component\TimerComponent.cs" />
     <Compile Include="Assets\Scripts\Entity\AssetBundleLoaderAsync.cs" />
+    <Compile Include="Assets\Scripts\Entity\Config\BuffConfig.cs" />
+    <Compile Include="Assets\Scripts\Entity\Config\UnitConfig.cs" />
     <Compile Include="Assets\Scripts\Entity\Game.cs" />
     <Compile Include="Assets\Scripts\Entity\Message\InnerMessage.cs" />
     <Compile Include="Assets\Scripts\Entity\Message\Opcode.cs" />
@@ -539,7 +549,8 @@
     <None Include="Assets\JsonDotNet\Assemblies\Windows\Newtonsoft.Json.XML" />
     <None Include="Assets\JsonDotNet\link.xml" />
     <None Include="Assets\Res\Config\BuffConfig.txt" />
+    <None Include="Assets\Res\Config\UnitConfig.txt" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />
-</Project>
+</Project>