Parcourir la source

1.增加打包工具
2.资源包使用引用计数,有同步跟异步加载资源的方式

tanghai il y a 8 ans
Parent
commit
2bf92b6553
100 fichiers modifiés avec 2073 ajouts et 512 suppressions
  1. 17 9
      Doc/运行指南.md
  2. BIN
      FileServer/FileServer.exe
  3. 11 0
      FileServer/FileServer.go
  4. 9 0
      Unity/Assets/Bundles/Code.meta
  5. 0 0
      Unity/Assets/Bundles/Code/Code.prefab
  6. 2 1
      Unity/Assets/Bundles/Code/Code.prefab.meta
  7. 9 0
      Unity/Assets/Bundles/Config.meta
  8. 0 0
      Unity/Assets/Bundles/Config/Config.prefab
  9. 2 1
      Unity/Assets/Bundles/Config/Config.prefab.meta
  10. 1 1
      Unity/Assets/Bundles/UI/UILobby.prefab.meta
  11. 1 1
      Unity/Assets/Bundles/UI/UILogin.prefab.meta
  12. 9 0
      Unity/Assets/Bundles/Unit.meta
  13. 0 0
      Unity/Assets/Bundles/Unit/Unit.prefab
  14. 1 1
      Unity/Assets/Bundles/Unit/Unit.prefab.meta
  15. 0 179
      Unity/Assets/Editor/BuildEditor/BuildABEditor.cs
  16. 0 3
      Unity/Assets/Editor/BuildEditor/BuildABEditor.cs.meta
  17. 144 123
      Unity/Assets/Editor/BuildEditor/BuildEditor.cs
  18. 3 12
      Unity/Assets/Editor/BuildEditor/BuildEditor.cs.meta
  19. 131 0
      Unity/Assets/Editor/BuildEditor/BuildHelper.cs
  20. 2 2
      Unity/Assets/Editor/BuildEditor/BuildHelper.cs.meta
  21. 3 0
      Unity/Assets/Editor/GlobalConfigEditor.meta
  22. 44 0
      Unity/Assets/Editor/GlobalConfigEditor/GlobalConfigEditor.cs
  23. 3 0
      Unity/Assets/Editor/GlobalConfigEditor/GlobalConfigEditor.cs.meta
  24. 9 15
      Unity/Assets/Editor/Helper/EditorResHelper.cs
  25. 1 1
      Unity/Assets/Plugins/Editor/JetBrains/Unity3DRider.cs
  26. 1 0
      Unity/Assets/Res/Config/GlobalProto.txt
  27. 8 0
      Unity/Assets/Res/Config/GlobalProto.txt.meta
  28. 13 14
      Unity/Assets/Resources/KV.prefab
  29. 1 1
      Unity/Assets/Resources/KV.prefab.meta
  30. 9 0
      Unity/Assets/Resources/UI.meta
  31. 197 0
      Unity/Assets/Resources/UI/UILoading.prefab
  32. 9 0
      Unity/Assets/Resources/UI/UILoading.prefab.meta
  33. 6 4
      Unity/Assets/Scenes/Init.unity
  34. 16 1
      Unity/Assets/Scripts/Base/Config/ConfigHelper.cs
  35. 3 0
      Unity/Assets/Scripts/Base/Event/EventIdType.cs
  36. 15 0
      Unity/Assets/Scripts/Base/Helper/FileHelper.cs
  37. 8 1
      Unity/Assets/Scripts/Base/Object/Disposer.cs
  38. 11 2
      Unity/Assets/Scripts/Base/Object/Object.cs
  39. 33 3
      Unity/Assets/Scripts/Base/QueueDictionary.cs
  40. 213 0
      Unity/Assets/Scripts/Component/BundleDownloaderComponent.cs
  41. 3 0
      Unity/Assets/Scripts/Component/BundleDownloaderComponent.cs.meta
  42. 21 0
      Unity/Assets/Scripts/Component/Config/GlobalProto.cs
  43. 3 0
      Unity/Assets/Scripts/Component/Config/GlobalProto.cs.meta
  44. 24 0
      Unity/Assets/Scripts/Component/GlobalConfigComponent.cs
  45. 3 0
      Unity/Assets/Scripts/Component/GlobalConfigComponent.cs.meta
  46. 236 63
      Unity/Assets/Scripts/Component/ResourcesComponent.cs
  47. 149 0
      Unity/Assets/Scripts/Component/UIComponent.cs
  48. 12 0
      Unity/Assets/Scripts/Component/UIComponent.cs.meta
  49. 49 0
      Unity/Assets/Scripts/Entity/AssetsBundleLoaderAsync.cs
  50. 3 0
      Unity/Assets/Scripts/Entity/AssetsBundleLoaderAsync.cs.meta
  51. 23 5
      Unity/Assets/Scripts/Entity/AssetsLoaderAsync.cs
  52. 3 0
      Unity/Assets/Scripts/Entity/AssetsLoaderAsync.cs.meta
  53. 101 0
      Unity/Assets/Scripts/Entity/UI.cs
  54. 3 0
      Unity/Assets/Scripts/Entity/UI.cs.meta
  55. 96 0
      Unity/Assets/Scripts/Entity/UnityWebRequestAsync.cs
  56. 3 0
      Unity/Assets/Scripts/Entity/UnityWebRequestAsync.cs.meta
  57. 4 1
      Unity/Assets/Scripts/Factory/UnitFactory.cs
  58. 4 0
      Unity/Assets/Scripts/Handler/Actor_CreateUnitsHandler.cs
  59. 46 0
      Unity/Assets/Scripts/Helper/BundleHelper.cs
  60. 3 0
      Unity/Assets/Scripts/Helper/BundleHelper.cs.meta
  61. 4 4
      Unity/Assets/Scripts/Helper/DllHelper.cs
  62. 1 1
      Unity/Assets/Scripts/Helper/PathHelper.cs
  63. 0 0
      Unity/Assets/Scripts/Helper/PathHelper.cs.meta
  64. 28 0
      Unity/Assets/Scripts/Helper/ResourcesHelper.cs
  65. 3 0
      Unity/Assets/Scripts/Helper/ResourcesHelper.cs.meta
  66. 30 14
      Unity/Assets/Scripts/Init.cs
  67. 10 0
      Unity/Assets/Scripts/Other/IUIFactory.cs
  68. 12 0
      Unity/Assets/Scripts/Other/IUIFactory.cs.meta
  69. 1 1
      Unity/Assets/Scripts/Other/UIFactoryAttribute.cs
  70. 12 0
      Unity/Assets/Scripts/Other/UIFactoryAttribute.cs.meta
  71. 10 0
      Unity/Assets/Scripts/Other/UIType.cs
  72. 12 0
      Unity/Assets/Scripts/Other/UIType.cs.meta
  73. 3 0
      Unity/Assets/Scripts/UI.meta
  74. 3 0
      Unity/Assets/Scripts/UI/UILoading.meta
  75. 3 0
      Unity/Assets/Scripts/UI/UILoading/Component.meta
  76. 44 0
      Unity/Assets/Scripts/UI/UILoading/Component/UILoadingComponent.cs
  77. 3 0
      Unity/Assets/Scripts/UI/UILoading/Component/UILoadingComponent.cs.meta
  78. 9 0
      Unity/Assets/Scripts/UI/UILoading/Event.meta
  79. 11 0
      Unity/Assets/Scripts/UI/UILoading/Event/LoadingBeginEvent_CreateLoadingUI.cs
  80. 12 0
      Unity/Assets/Scripts/UI/UILoading/Event/LoadingBeginEvent_CreateLoadingUI.cs.meta
  81. 11 0
      Unity/Assets/Scripts/UI/UILoading/Event/LoadingFinishEvent_RemoveLoadingUI.cs
  82. 12 0
      Unity/Assets/Scripts/UI/UILoading/Event/LoadingFinishEvent_RemoveLoadingUI.cs.meta
  83. 3 0
      Unity/Assets/Scripts/UI/UILoading/Factory.meta
  84. 32 0
      Unity/Assets/Scripts/UI/UILoading/Factory/UILoadingFactory.cs
  85. 3 0
      Unity/Assets/Scripts/UI/UILoading/Factory/UILoadingFactory.cs.meta
  86. 1 0
      Unity/Hotfix/Base/Other/IUIFactory.cs
  87. 0 9
      Unity/Hotfix/Base/Other/UIType.cs
  88. 0 1
      Unity/Hotfix/Init.cs
  89. 1 1
      Unity/Hotfix/UI/UILobby/Component/UILobbyComponent.cs
  90. 9 2
      Unity/Hotfix/UI/UILobby/Factory/UILobbyFactory.cs
  91. 3 3
      Unity/Hotfix/UI/UILogin/Component/UILoginComponent.cs
  92. 1 1
      Unity/Hotfix/UI/UILogin/Event/InitSceneStart_CreateLoginUI.cs
  93. 10 3
      Unity/Hotfix/UI/UILogin/Factory/UILoginFactory.cs
  94. 4 4
      Unity/Hotfix/Unity.Hotfix.csproj
  95. 1 0
      Unity/ProjectSettings/ProjectSettings.asset
  96. 1 1
      Unity/ProjectSettings/ProjectVersion.txt
  97. 4 5
      Unity/Unity.Editor.Plugins.csproj
  98. 6 6
      Unity/Unity.Editor.csproj
  99. 4 5
      Unity/Unity.Plugins.csproj
  100. 22 7
      Unity/Unity.csproj

+ 17 - 9
Doc/运行指南.md

@@ -1,7 +1,7 @@
 ##### 1.visual studio必须使用vs2017,其它版本不支持,VS2017需要勾选安装以下内容:
 .net 桌面开发   
 使用C++的桌面开发,VC++ 2017 v141工具集,对C++的xp支持  
-visual studio tools for unity  .netcore2.0
+visual studio tools for unity .netcore2.0
 ##### 2. unity一定要安装 unity 2017.1.0p5到2017.1.2,其它版本不支持
 
 ##### 3. 启动unity2017, 菜单 File->open project->open 选中Egametang/Unity文件夹,点击选择文件夹按钮。
@@ -13,15 +13,23 @@ visual studio tools for unity  .netcore2.0
 ##### 6.打开Unity->tools菜单->命令行配置,选择LocalAllServer.txt 这是启动单一App的方式,如果要启动一组多App服务器,在命令行工具中选择127.0.0.1.txt,点击启动即可,具体配置都可以自己用这个命令行配置工具修改
 ##### 7.点击工具中的启动,这样就启动了服务端(也可以用VS启动,方便单步调试)
 ##### 8.运行Unity,输入帐号,点击登录这时日志 连接Gate成功,表示运行OK!
-  
-## 测试帧同步  
-##### 1. Unity->tools菜单->打包->PC打包, 打出一个PC包在Release目录下
-##### 2. 运行Unity 登录 进入大厅 进入场景
-##### 3. 运行PC包 登录 进入大厅   这时会出现两个小人(重叠在一起)
-##### 4. 点击鼠标右键即可移动人物
+
 
 # 注意事项:
-VS2017 15.4版本有bug,会提示Hotfix找不到Assembly-CSharp.dll,需要将Hotfix工程引用的Unity跟Unity.Plugin去掉,直接引用Unity\Library\ScriptAssemblies目录中Assembly-CSharp.dll跟Assembly-CSharp-firstpass.dll两个dll  
+VS2017 15.4版本vstools有bug,Hotfix工程请重新引用UnityEngin跟UnityEngineUI两个dll,这两个dll在Unity安装目录/Editor/Data/Managed/下面
 
-一般出错原因都是 1.没编译。2.中文目录。3.vs没有安装vs tools或者不是最新的vs tools。4.没安装.netcore2.0
+一般出错原因都是:  
+1.出现LateUpate找不到表示没编译hotfix。  
+2.中文目录。  
+3.vs没有安装vs tools或者不是最新的vs tools。  
+4.没安装.netcore2.0  
+
+  
+## 测试帧同步  
+##### 1. 打开Unity->tools菜单->命令行配置,重启server
+##### 2. Unity->tools菜单->打包工具,点击标记,选择PC,勾选是否打包exe,点击开始打包,打出一个PC包在Release目录下,
+##### 3. 运行Unity 登录 进入大厅 进入场景
+##### 4. 启动unity菜单->tools->web资源服务器
+##### 5. 运行PC包 登录 进入大厅 这时会出现两个小人(重叠在一起)
+##### 6. 点击鼠标右键即可移动人物
 

BIN
FileServer/FileServer.exe


+ 11 - 0
FileServer/FileServer.go

@@ -0,0 +1,11 @@
+package main
+
+import (
+	"log"
+	"net/http"
+)
+
+func main() {
+	// Simple static webserver:
+	log.Fatal(http.ListenAndServe(":8080", http.FileServer(http.Dir("../Release/"))))
+}

+ 9 - 0
Unity/Assets/Bundles/Code.meta

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

+ 0 - 0
Unity/Assets/Resources/Code.prefab → Unity/Assets/Bundles/Code/Code.prefab


+ 2 - 1
Unity/Assets/Resources/Code.prefab.meta → Unity/Assets/Bundles/Code/Code.prefab.meta

@@ -3,6 +3,7 @@ guid: 3b43dd0baf9d83c4894a9b47b019a45b
 timeCreated: 1474946800
 licenseType: Pro
 NativeFormatImporter:
+  mainObjectFileID: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: code.unity3d
   assetBundleVariant: 

+ 9 - 0
Unity/Assets/Bundles/Config.meta

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

+ 0 - 0
Unity/Assets/Resources/Config.prefab → Unity/Assets/Bundles/Config/Config.prefab


+ 2 - 1
Unity/Assets/Resources/Config.prefab.meta → Unity/Assets/Bundles/Config/Config.prefab.meta

@@ -3,6 +3,7 @@ guid: 59151e2fab0f8f645bac00178f4344ac
 timeCreated: 1474946800
 licenseType: Pro
 NativeFormatImporter:
+  mainObjectFileID: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: config.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Bundles/UI/UILobby.prefab.meta

@@ -5,5 +5,5 @@ licenseType: Free
 NativeFormatImporter:
   mainObjectFileID: 100100000
   userData: 
-  assetBundleName: 
+  assetBundleName: uilobby.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Bundles/UI/UILogin.prefab.meta

@@ -5,5 +5,5 @@ licenseType: Free
 NativeFormatImporter:
   mainObjectFileID: 100100000
   userData: 
-  assetBundleName: 
+  assetBundleName: uilogin.unity3d
   assetBundleVariant: 

+ 9 - 0
Unity/Assets/Bundles/Unit.meta

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

+ 0 - 0
Unity/Assets/Resources/Unit.prefab → Unity/Assets/Bundles/Unit/Unit.prefab


+ 1 - 1
Unity/Assets/Resources/Unit.prefab.meta → Unity/Assets/Bundles/Unit/Unit.prefab.meta

@@ -5,5 +5,5 @@ licenseType: Free
 NativeFormatImporter:
   mainObjectFileID: 100100000
   userData: 
-  assetBundleName: 
+  assetBundleName: unit.unity3d
   assetBundleVariant: 

+ 0 - 179
Unity/Assets/Editor/BuildEditor/BuildABEditor.cs

@@ -1,179 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using Model;
-using UnityEditor;
-using UnityEngine;
-
-namespace MyEditor
-{
-	public class BundleInfo
-	{
-		public List<string> ParentPaths = new List<string>();
-	}
-	
-	public class BuildABEditor: EditorWindow
-	{
-		private readonly Dictionary<string, BundleInfo> dictionary = new Dictionary<string, BundleInfo>();
-		
-		[MenuItem("Tools/打包/设置标记")]
-		private static void ShowWindow()
-		{
-			GetWindow<BuildABEditor>();
-		}
-
-		private void OnGUI()
-		{
-			if (GUILayout.Button("设置标记"))
-			{
-				SetPackingTagAndAssetBundle();
-			}
-
-			if (GUILayout.Button("清除标记"))
-			{
-				ClearPackingTagAndAssetBundle();
-			}
-
-			if (GUILayout.Button("清除并且设置"))
-			{
-				ClearPackingTagAndAssetBundle();
-				SetPackingTagAndAssetBundle();
-			}
-		}
-
-		private void SetPackingTagAndAssetBundle()
-		{
-			string[] subDirectories = Directory.GetDirectories("Assets/Bundles/");
-
-			foreach (string subDirectory in subDirectories)
-			{
-				Log.Info($"开始设置目录:{subDirectory}");
-				DirectoryInfo info = new DirectoryInfo(subDirectory);
-				SetOneDirPackingTagAndAssetBundle(info.Name);
-				Log.Info($"结束设置目录:{subDirectory}");
-
-				Log.Info($"--------------------------------------");
-			}
-		}
-
-		private void SetOneDirPackingTagAndAssetBundle(string dirName)
-		{
-			this.dictionary.Clear();
-			List<string> paths = EditorResHelper.GetAllPath($"Assets/Bundles/{dirName}", true);
-
-			foreach (string path in paths)
-			{
-				string path1 = path.Replace('\\', '/');
-				GameObject go = AssetDatabase.LoadAssetAtPath<GameObject>(path1);
-				AssetImporter importer = AssetImporter.GetAtPath(path1);
-				importer.assetBundleName = $"{go.name}.unity3d";
-					
-				UnityEngine.Object[] objects = EditorUtility.CollectDependencies(new UnityEngine.Object[] { go });
-				foreach (UnityEngine.Object o in objects)
-				{
-					string pt = AssetDatabase.GetAssetPath(o);
-					string extension = Path.GetExtension(pt);
-					if (extension == ".cs" || extension == ".dll")
-					{
-						continue;
-					}
-					if (pt.Contains("Resources"))
-					{
-						continue;
-					}
-					if (pt == path1)
-					{
-						continue;
-					}
-
-					// 不存在则记录下来
-					if (!this.dictionary.ContainsKey(pt))
-					{					
-						Log.Info($"{path1}----{pt}");
-						BundleInfo bundleInfo = new BundleInfo();
-						bundleInfo.ParentPaths.Add(path1);
-						this.dictionary.Add(pt, bundleInfo);
-							
-						AssetImporter importer3 = AssetImporter.GetAtPath(pt);
-						TextureImporter textureImporter3 = importer3 as TextureImporter;
-						if (textureImporter3 != null)
-						{
-							textureImporter3.spritePackingTag = go.name;
-						}
-							
-						continue;
-					}
-
-					// 依赖的父亲不一样
-					BundleInfo info = this.dictionary[pt];
-					if (info.ParentPaths.Contains(path1))
-					{
-						continue;
-					}
-					info.ParentPaths.Add(path1);
-						
-					AssetImporter importer2 = AssetImporter.GetAtPath(pt);
-					if (importer2 == null)
-					{
-						continue;
-					}
-
-					if (importer2.assetBundleName != "")
-					{
-						continue;
-					}
-						
-					
-					importer2.assetBundleName = $"{dirName}share.unity3d";
-					Log.Warning($"{importer2.assetBundleName}: {pt} {info.ParentPaths.ListToString()}");
-
-					TextureImporter textureImporter = importer2 as TextureImporter;
-					if (textureImporter != null)
-					{
-						textureImporter.spritePackingTag = $"{dirName}share";
-					}
-				}
-			}
-		}
-
-		private static void ClearPackingTagAndAssetBundle()
-		{
-			List<string> bundlePaths = EditorResHelper.GetAllResourcePath("Assets/Bundles", true);
-			foreach (string bundlePath in bundlePaths)
-			{
-				AssetImporter importer = AssetImporter.GetAtPath(bundlePath);
-				if (importer == null)
-				{
-					continue;
-				}
-				//Log.Info(bundlePath);
-				importer.assetBundleName = "";
-			}
-			
-			List<string> paths = EditorResHelper.GetAllResourcePath("Assets/Res", true);
-			foreach (string path in paths)
-			{
-				string extendName = Path.GetExtension(path);
-				if (extendName == ".cs")
-				{
-					continue;
-				}
-				
-				AssetImporter importer = AssetImporter.GetAtPath(path);
-				if (importer == null)
-				{
-					continue;
-				}
-
-				//Log.Info(path);
-
-				importer.assetBundleName = "";
-
-				TextureImporter textureImporter = importer as TextureImporter;
-				if (textureImporter != null)
-				{
-					textureImporter.spritePackingTag = "";
-				}
-			}
-		}
-	}
-}

+ 0 - 3
Unity/Assets/Editor/BuildEditor/BuildABEditor.cs.meta

@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 52155b8c452647ec8b84033519269054
-timeCreated: 1507865387

+ 144 - 123
Unity/Assets/Editor/BuildEditor/BuildEditor.cs

@@ -1,166 +1,187 @@
-using System.IO;
+using System.Collections.Generic;
+using System.IO;
 using Model;
 using UnityEditor;
+using UnityEngine;
 
 namespace MyEditor
 {
-	public class BuildEditor : EditorWindow
+	public class BundleInfo
 	{
-		private static BuildOptions option = BuildOptions.Development | BuildOptions.AllowDebugging;
-		private const string relativeDirPrefix = "../Release";
-
-		public static string abFolderAndroid = "../Release/Android/StreamingAssets/";
-
-		public static string abFolderPC = "../Release/PC/StreamingAssets/";
+		public List<string> ParentPaths = new List<string>();
+	}
 
-		public static string abFolderIOS = "../Release/IOS/StreamingAssets/";
+	public enum PlatformType
+	{
+		PC,
+		Android,
+		IOS,
+	}
 
-		[MenuItem("Tools/编译")]
-		public static void BuildHotfix()
-		{
-			System.Diagnostics.Process process = new System.Diagnostics.Process();
-			string unityDir = System.Environment.GetEnvironmentVariable("Unity");
-			if (string.IsNullOrEmpty(unityDir))
-			{
-				Log.Error("没有设置Unity环境变量!");
-				return;
-			}
-			process.StartInfo.FileName = $@"{unityDir}\Editor\Data\MonoBleedingEdge\bin\mono.exe";
-			process.StartInfo.Arguments = $@"{unityDir}\Editor\Data\MonoBleedingEdge\lib\mono\xbuild\14.0\bin\xbuild.exe .\Hotfix\Unity.Hotfix.csproj";
-			process.StartInfo.UseShellExecute = false;
-			process.StartInfo.WorkingDirectory = @".\";
-			process.StartInfo.RedirectStandardOutput = true;
-			process.StartInfo.RedirectStandardError = true;
-			process.Start();
-			string info = process.StandardOutput.ReadToEnd();
-			process.WaitForExit();
-			process.Close();
-			Log.Info(info);
-		}
+	public class BuildEditor : EditorWindow
+	{
+		private readonly Dictionary<string, BundleInfo> dictionary = new Dictionary<string, BundleInfo>();
 
-		[MenuItem("Tools/打开文件服务器")]
-		public static void OpenFileServer()
-		{
-			string currentDir = System.Environment.CurrentDirectory;
-			string path = Path.Combine(currentDir, @"..\FileServer\");
-			System.Diagnostics.Process process = new System.Diagnostics.Process();
-			process.StartInfo.FileName = "FileServer.exe";
-			process.StartInfo.WorkingDirectory = path;
-			process.StartInfo.CreateNoWindow = true;
-			process.Start();
-		}
+		private PlatformType platformType;
+		private bool isBuildExe;
+		private BuildOptions buildOptions;
 
-		[MenuItem("Tools/打包/PC打包")]
-		public static void BuildPC()
+		[MenuItem("Tools/打包工具")]
+		public static void ShowWindow()
 		{
-			BuildAssetBundlesPC();
-
-			string[] levels2 = {
-				"Assets/Scenes/Init.unity",
-			};
-			BuildPipeline.BuildPlayer(levels2, $"{relativeDirPrefix}/et.exe", BuildTarget.StandaloneWindows, option);
-			Log.Info("打包完成");
+			GetWindow(typeof(BuildEditor));
 		}
 
-		[MenuItem("Tools/打包/Android打包")]
-		public static void BuildAndroid()
+		private void OnGUI()
 		{
-			BuildAssetBundlesAndroid();
+			if (GUILayout.Button("标记"))
+			{
+				SetPackingTagAndAssetBundle();
+			}
 
-			string[] levels2 = {
-				"Assets/Scenes/Init.unity",
-			};
-			BuildPipeline.BuildPlayer(levels2, $"{relativeDirPrefix}/et.apk", BuildTarget.Android, option);
-			Log.Info("打包完成");
-		}
+			EditorGUILayout.BeginHorizontal();
+			this.platformType = (PlatformType)EditorGUILayout.EnumPopup(platformType);
+			this.isBuildExe = EditorGUILayout.Toggle("是否打包EXE: ", this.isBuildExe);
+			EditorGUILayout.EndHorizontal();
 
-		[MenuItem("Tools/打包/Android打包APK")]
-		public static void BuildAPK()
-		{
-			string[] levels2 = {
-				"Assets/Scenes/Init.unity",
-			};
-			BuildPipeline.BuildPlayer(levels2, $"{relativeDirPrefix}/et.apk", BuildTarget.Android, option);
-			Log.Info("打包APK完成");
-		}
+			this.buildOptions = (BuildOptions)EditorGUILayout.EnumMaskField("BuildOptions(可多选): ", this.buildOptions);
 
-		[MenuItem("Tools/打包/PC生成资源包")]
-		public static void BuildAssetBundlesPC()
-		{
-			if (!Directory.Exists(abFolderPC))
+			if (GUILayout.Button("开始打包"))
 			{
-				Directory.CreateDirectory(abFolderPC);
+				BuildHelper.Build(this.platformType, BuildOptions.None, this.isBuildExe);
 			}
-			BuildPipeline.BuildAssetBundles(abFolderPC, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows);
-
-			GenerateVersionInfo(abFolderPC);
-			Log.Info("生成资源包完成");
 		}
 
-		[MenuItem("Tools/打包/Android生成资源包")]
-		public static void BuildAssetBundlesAndroid()
+		private void SetPackingTagAndAssetBundle()
 		{
-			if (!Directory.Exists(abFolderAndroid))
-			{
-				Directory.CreateDirectory(abFolderAndroid);
-			}
-			BuildPipeline.BuildAssetBundles(abFolderAndroid, BuildAssetBundleOptions.None, BuildTarget.Android);
-
-			GenerateVersionInfo(abFolderAndroid);
-			Log.Info("生成资源包完成");
+			ClearPackingTagAndAssetBundle();
+			
+			SetOneDirPackingTagAndAssetBundle("Assets/Bundles/");
 		}
 
-		[MenuItem("Tools/打包/IOS生成资源包")]
-		public static void BuildAssetBundlesIOS()
+		private void SetOneDirPackingTagAndAssetBundle(string dir)
 		{
-			if (!Directory.Exists(abFolderIOS))
+			this.dictionary.Clear();
+			List<string> paths = EditorResHelper.GetPrefabsAndScenes(dir);
+
+			foreach (string path in paths)
 			{
-				Directory.CreateDirectory(abFolderIOS);
-			}
-			BuildPipeline.BuildAssetBundles(abFolderIOS, BuildAssetBundleOptions.None, BuildTarget.iOS);
+				string path1 = path.Replace('\\', '/');
+				UnityEngine.Object go = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(path1);
+				AssetImporter importer = AssetImporter.GetAtPath(path1);
+				if (importer == null || go == null)
+				{
+					Log.Error("error: " + path1);
+					continue;
+				}
+				importer.assetBundleName = $"{go.name}.unity3d";
 
-			GenerateVersionInfo(abFolderIOS);
-			Log.Info("生成资源包完成");
+				UnityEngine.Object[] objects = EditorUtility.CollectDependencies(new[] { go });
+				foreach (UnityEngine.Object o in objects)
+				{
+					string pt = AssetDatabase.GetAssetPath(o);
+					string extension = Path.GetExtension(pt);
+					if (extension == ".cs" || extension == ".dll")
+					{
+						continue;
+					}
+					if (pt.Contains("Resources"))
+					{
+						continue;
+					}
+					if (pt == path1)
+					{
+						continue;
+					}
+
+					// 不存在则记录下来
+					if (!this.dictionary.ContainsKey(pt))
+					{
+						Log.Info($"{path1}----{pt}");
+						BundleInfo bundleInfo = new BundleInfo();
+						bundleInfo.ParentPaths.Add(path1);
+						this.dictionary.Add(pt, bundleInfo);
+
+						AssetImporter importer3 = AssetImporter.GetAtPath(pt);
+						TextureImporter textureImporter3 = importer3 as TextureImporter;
+						if (textureImporter3 != null)
+						{
+							textureImporter3.spritePackingTag = go.name;
+						}
+
+						continue;
+					}
+
+					// 依赖的父亲不一样
+					BundleInfo info = this.dictionary[pt];
+					if (info.ParentPaths.Contains(path1))
+					{
+						continue;
+					}
+					info.ParentPaths.Add(path1);
+
+					AssetImporter importer2 = AssetImporter.GetAtPath(pt);
+					if (importer2 == null)
+					{
+						continue;
+					}
+
+					if (importer2.assetBundleName != "")
+					{
+						continue;
+					}
+
+
+					importer2.assetBundleName = $"share.unity3d";
+					Log.Warning($"{importer2.assetBundleName}: {pt} {info.ParentPaths.ListToString()}");
+
+					TextureImporter textureImporter = importer2 as TextureImporter;
+					if (textureImporter != null)
+					{
+						textureImporter.spritePackingTag = $"share";
+					}
+				}
+			}
 		}
 
-		private static void GenerateVersionInfo(string dir)
+		private static void ClearPackingTagAndAssetBundle()
 		{
-			VersionConfig versionProto = new VersionConfig();
-			GenerateVersionInfo3(dir, versionProto, "");
-
-			using (FileStream fileStream = new FileStream($"{dir}/Version.txt", FileMode.Create))
+			List<string> bundlePaths = EditorResHelper.GetAllResourcePath("Assets/Bundles", true);
+			foreach (string bundlePath in bundlePaths)
 			{
-				byte[] bytes = MongoHelper.ToJson(versionProto).ToByteArray();
-				fileStream.Write(bytes, 0, bytes.Length);
+				AssetImporter importer = AssetImporter.GetAtPath(bundlePath);
+				if (importer == null)
+				{
+					continue;
+				}
+				//Log.Info(bundlePath);
+				importer.assetBundleName = "";
 			}
-		}
 
-		private static void GenerateVersionInfo3(string dir, VersionConfig versionProto, string relativePath)
-		{
-			foreach (string file in Directory.GetFiles(dir))
+			List<string> paths = EditorResHelper.GetAllResourcePath("Assets/Res", true);
+			foreach (string path in paths)
 			{
-				if (file.EndsWith(".manifest"))
+				string extendName = Path.GetExtension(path);
+				if (extendName == ".cs")
 				{
 					continue;
 				}
-				string md5 = MD5Helper.FileMD5(file);
-				FileInfo fi = new FileInfo(file);
-				long size = fi.Length;
-				string filePath = relativePath == "" ? fi.Name : $"{relativePath}/{fi.Name}";
 
-				versionProto.FileVersionInfos.Add(new FileVersionInfo
+				AssetImporter importer = AssetImporter.GetAtPath(path);
+				if (importer == null)
 				{
-					File = filePath,
-					MD5 = md5,
-					Size = size,
-				});
-			}
+					continue;
+				}
 
-			foreach (string directory in Directory.GetDirectories(dir))
-			{
-				DirectoryInfo dinfo = new DirectoryInfo(directory);
-				string rel = relativePath == "" ? dinfo.Name : $"{relativePath}/{dinfo.Name}";
-				GenerateVersionInfo3($"{dir}/{dinfo.Name}", versionProto, rel);
+				//Log.Info(path);
+
+				importer.assetBundleName = "";
+
+				TextureImporter textureImporter = importer as TextureImporter;
+				if (textureImporter != null)
+				{
+					textureImporter.spritePackingTag = "";
+				}
 			}
 		}
 	}

+ 3 - 12
Unity/Assets/Editor/BuildEditor/BuildEditor.cs.meta

@@ -1,12 +1,3 @@
-fileFormatVersion: 2
-guid: 53b50d5bc43bd1449b2ab7a3e536154f
-timeCreated: 1503647642
-licenseType: Free
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 52155b8c452647ec8b84033519269054
+timeCreated: 1507865387

+ 131 - 0
Unity/Assets/Editor/BuildEditor/BuildHelper.cs

@@ -0,0 +1,131 @@
+using System.IO;
+using Model;
+using UnityEditor;
+
+namespace MyEditor
+{
+	public static class BuildHelper
+	{
+		private const string relativeDirPrefix = "../Release";
+
+		public static string BuildFolder = "../Release/{0}/StreamingAssets/";
+		
+		[MenuItem("Tools/编译Hotfix")]
+		public static void BuildHotfix()
+		{
+			System.Diagnostics.Process process = new System.Diagnostics.Process();
+			string unityDir = System.Environment.GetEnvironmentVariable("Unity");
+			if (string.IsNullOrEmpty(unityDir))
+			{
+				Log.Error("没有设置Unity环境变量!");
+				return;
+			}
+			process.StartInfo.FileName = $@"{unityDir}\Editor\Data\MonoBleedingEdge\bin\mono.exe";
+			process.StartInfo.Arguments = $@"{unityDir}\Editor\Data\MonoBleedingEdge\lib\mono\xbuild\14.0\bin\xbuild.exe .\Hotfix\Unity.Hotfix.csproj";
+			process.StartInfo.UseShellExecute = false;
+			process.StartInfo.WorkingDirectory = @".\";
+			process.StartInfo.RedirectStandardOutput = true;
+			process.StartInfo.RedirectStandardError = true;
+			process.Start();
+			string info = process.StandardOutput.ReadToEnd();
+			process.WaitForExit();
+			process.Close();
+			Log.Info(info);
+		}
+
+		[MenuItem("Tools/Web资源服务器")]
+		public static void OpenFileServer()
+		{
+			string currentDir = System.Environment.CurrentDirectory;
+			string path = Path.Combine(currentDir, @"..\FileServer\");
+			System.Diagnostics.Process process = new System.Diagnostics.Process();
+			process.StartInfo.FileName = "FileServer.exe";
+			process.StartInfo.WorkingDirectory = path;
+			process.StartInfo.CreateNoWindow = true;
+			process.Start();
+		}
+
+		public static void Build(PlatformType type, BuildOptions options, bool isBuildExe)
+		{
+			BuildTarget buildTarget = BuildTarget.StandaloneWindows;
+			string exeName = "ET";
+			switch (type)
+			{
+				case PlatformType.PC:
+					buildTarget = BuildTarget.StandaloneWindows;
+					exeName += ".exe";
+					break;
+				case PlatformType.Android:
+					buildTarget = BuildTarget.Android;
+					exeName += ".apk";
+					break;
+				case PlatformType.IOS:
+					buildTarget = BuildTarget.iOS;
+					break;
+			}
+
+			string fold = string.Format(BuildFolder, type);
+			if (!Directory.Exists(fold))
+			{
+				Directory.CreateDirectory(fold);
+			}
+			
+			Log.Info("开始资源打包");
+			BuildPipeline.BuildAssetBundles(fold, BuildAssetBundleOptions.None, buildTarget);
+
+			GenerateVersionInfo(fold);
+			Log.Info("完成资源打包");
+			
+			if (isBuildExe)
+			{
+				string[] levels = {
+					"Assets/Scenes/Init.unity",
+				};
+				Log.Info("开始EXE打包");
+				BuildPipeline.BuildPlayer(levels, $"{relativeDirPrefix}/{exeName}", buildTarget, options);
+				Log.Info("完成exe打包");
+			}
+		}
+
+		private static void GenerateVersionInfo(string dir)
+		{
+			VersionConfig versionProto = new VersionConfig();
+			GenerateVersionProto(dir, versionProto, "");
+
+			using (FileStream fileStream = new FileStream($"{dir}/Version.txt", FileMode.Create))
+			{
+				byte[] bytes = MongoHelper.ToJson(versionProto).ToByteArray();
+				fileStream.Write(bytes, 0, bytes.Length);
+			}
+		}
+
+		private static void GenerateVersionProto(string dir, VersionConfig versionProto, string relativePath)
+		{
+			foreach (string file in Directory.GetFiles(dir))
+			{
+				if (file.EndsWith(".manifest"))
+				{
+					continue;
+				}
+				string md5 = MD5Helper.FileMD5(file);
+				FileInfo fi = new FileInfo(file);
+				long size = fi.Length;
+				string filePath = relativePath == "" ? fi.Name : $"{relativePath}/{fi.Name}";
+
+				versionProto.FileVersionInfos.Add(new FileVersionInfo
+				{
+					File = filePath,
+					MD5 = md5,
+					Size = size,
+				});
+			}
+
+			foreach (string directory in Directory.GetDirectories(dir))
+			{
+				DirectoryInfo dinfo = new DirectoryInfo(directory);
+				string rel = relativePath == "" ? dinfo.Name : $"{relativePath}/{dinfo.Name}";
+				GenerateVersionProto($"{dir}/{dinfo.Name}", versionProto, rel);
+			}
+		}
+	}
+}

+ 2 - 2
Unity/Assets/Scripts/Entity/AssetBundleLoaderAsync.cs.meta → Unity/Assets/Editor/BuildEditor/BuildHelper.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 3884a45c24f76244aa0697dcb9d95d15
-timeCreated: 1498117617
+guid: 53b50d5bc43bd1449b2ab7a3e536154f
+timeCreated: 1503647642
 licenseType: Free
 MonoImporter:
   serializedVersion: 2

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

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 213fa34dccaf4a66ae2ae115b04d7f82
+timeCreated: 1510807526

+ 44 - 0
Unity/Assets/Editor/GlobalConfigEditor/GlobalConfigEditor.cs

@@ -0,0 +1,44 @@
+using System.IO;
+using Model;
+using UnityEditor;
+using UnityEngine;
+
+namespace MyEditor
+{
+    public class GlobalProtoEditor: EditorWindow
+    {
+        const string path = @".\Assets\Res\Config\GlobalProto.txt";
+
+        private GlobalProto globalProto;
+
+        [MenuItem("Tools/全局配置")]
+        public static void ShowWindow()
+        {
+            GetWindow<GlobalProtoEditor>();
+        }
+
+        public void Awake()
+        {
+            if (File.Exists(path))
+            {
+                this.globalProto = MongoHelper.FromJson<GlobalProto>(File.ReadAllText(path));
+            }
+            else
+            {
+                this.globalProto = new GlobalProto();
+            }
+        }
+
+        public void OnGUI()
+        {
+            this.globalProto.AssetBundleServerUrl = EditorGUILayout.TextField("资源路径:", this.globalProto.AssetBundleServerUrl);
+            this.globalProto.Address = EditorGUILayout.TextField("服务器地址:", this.globalProto.Address);
+
+            if (GUILayout.Button("保存"))
+            {
+                File.WriteAllText(path, MongoHelper.ToJson(this.globalProto));
+                AssetDatabase.Refresh();
+            }
+        }
+    }
+}

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

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 51bd2599a7c84da9bfa90cd8d37db805
+timeCreated: 1510807539

+ 9 - 15
Unity/Assets/Editor/Helper/EditorResHelper.cs

@@ -6,31 +6,25 @@ namespace Model
     public class EditorResHelper
     {
         /// <summary>
-        /// 获取文件夹内所有的预制路径
+        /// 获取文件夹内所有的预制跟场景路径
         /// </summary>
         /// <param name="srcPath">源文件夹</param>
         /// <param name="subDire">是否获取子文件夹</param>
         /// <returns></returns>
-        public static List<string> GetAllPath(string srcPath, bool subDire)
+        public static List<string> GetPrefabsAndScenes(string srcPath)
         {
             List<string> paths = new List<string>();
-            string[] files = Directory.GetFiles(srcPath);
-            foreach (string str in files)
-            {
-                if (str.EndsWith(".prefab"))
-                {
-                    paths.Add(str);
-                }
-            }
-            if (subDire)
+            FileHelper.GetAllFiles(paths, srcPath);
+            
+            List<string> files = new List<string>();
+            foreach (string str in paths)
             {
-                foreach (string subPath in Directory.GetDirectories(srcPath))
+                if (str.EndsWith(".prefab") || str.EndsWith(".unity"))
                 {
-                    List<string> subFiles = GetAllPath(subPath, true);
-                    paths.AddRange(subFiles);
+                    files.Add(str);
                 }
             }
-            return paths;
+            return files;
         }
         
         /// <summary>

+ 1 - 1
Unity/Assets/Plugins/Editor/JetBrains/Unity3DRider.cs

@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Version: 2.1.2.1402
+//     Version: 2.1.2.1737
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.

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

@@ -0,0 +1 @@
+{ "_t" : "GlobalProto", "AssetBundleServerUrl" : "http://127.0.0.1:8080/", "Address" : "127.0.0.1:10002" }

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

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 78f3a209a7b81ec46a196b52eea7e541
+timeCreated: 1510807346
+licenseType: Free
+TextScriptImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 13 - 14
Unity/Assets/Resources/UI.prefab → Unity/Assets/Resources/KV.prefab

@@ -9,30 +9,30 @@ Prefab:
     m_Modifications: []
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 0}
-  m_RootGameObject: {fileID: 1770158272730698}
+  m_RootGameObject: {fileID: 1721544207891024}
   m_IsPrefabParent: 1
---- !u!1 &1770158272730698
+--- !u!1 &1721544207891024
 GameObject:
   m_ObjectHideFlags: 0
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 100100000}
   serializedVersion: 5
   m_Component:
-  - component: {fileID: 4092934652491172}
-  - component: {fileID: 114471626497006264}
+  - component: {fileID: 4697655011189034}
+  - component: {fileID: 114052459199459742}
   m_Layer: 0
-  m_Name: UI
+  m_Name: KV
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
   m_IsActive: 1
---- !u!4 &4092934652491172
+--- !u!4 &4697655011189034
 Transform:
   m_ObjectHideFlags: 1
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 100100000}
-  m_GameObject: {fileID: 1770158272730698}
+  m_GameObject: {fileID: 1721544207891024}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
@@ -40,21 +40,20 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!114 &114471626497006264
+--- !u!114 &114052459199459742
 MonoBehaviour:
   m_ObjectHideFlags: 1
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 100100000}
-  m_GameObject: {fileID: 1770158272730698}
+  m_GameObject: {fileID: 1721544207891024}
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_Script: {fileID: 11500000, guid: 502d8cafd6a5a0447ab1db9a24cdcb10, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
   data:
-  - key: UILogin
-    gameObject: {fileID: 1386170326414932, guid: 9f6d9adc6f537764fa0fea29671e77bf,
-      type: 2}
-  - key: UILobby
-    gameObject: {fileID: 1386170326414932, guid: d8d87e53d93e234448658c9a801a9967,
+  - key: UILoading
+    gameObject: {fileID: 1386170326414932, guid: 0deea0b3b021a714d8c54816d4ee5fbe,
       type: 2}
+  - key: GlobalProto
+    gameObject: {fileID: 4900000, guid: 78f3a209a7b81ec46a196b52eea7e541, type: 3}

+ 1 - 1
Unity/Assets/Resources/UI.prefab.meta → Unity/Assets/Resources/KV.prefab.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
 guid: 5b68b797892145f46a5553c74f060976
-timeCreated: 1506131440
+timeCreated: 1510748853
 licenseType: Free
 NativeFormatImporter:
   mainObjectFileID: 100100000

+ 9 - 0
Unity/Assets/Resources/UI.meta

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

+ 197 - 0
Unity/Assets/Resources/UI/UILoading.prefab

@@ -0,0 +1,197 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1001 &100100000
+Prefab:
+  m_ObjectHideFlags: 1
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 0}
+    m_Modifications: []
+    m_RemovedComponents: []
+  m_ParentPrefab: {fileID: 0}
+  m_RootGameObject: {fileID: 1386170326414932}
+  m_IsPrefabParent: 1
+--- !u!1 &1173942238304288
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 224850331409010544}
+  - component: {fileID: 222360589368841156}
+  - component: {fileID: 114379447962377268}
+  m_Layer: 5
+  m_Name: Text
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!1 &1386170326414932
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 224438795553994780}
+  - component: {fileID: 222767206446386334}
+  - component: {fileID: 114768094896805158}
+  - component: {fileID: 114699130285514482}
+  - component: {fileID: 114850350457908736}
+  - component: {fileID: 114013506589617068}
+  m_Layer: 5
+  m_Name: UILoading
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &114013506589617068
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1386170326414932}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 8347f75bbf20473292de676504ad7398, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  CanvasName: LoginCanvas
+--- !u!114 &114379447962377268
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1173942238304288}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_FontData:
+    m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+    m_FontSize: 36
+    m_FontStyle: 0
+    m_BestFit: 0
+    m_MinSize: 3
+    m_MaxSize: 40
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: 0%
+--- !u!114 &114699130285514482
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1386170326414932}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 8347f75bbf20473292de676504ad7398, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  CanvasName: LoginCanvas
+--- !u!114 &114768094896805158
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1386170326414932}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 0
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
+  m_Type: 1
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+--- !u!114 &114850350457908736
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1386170326414932}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 502d8cafd6a5a0447ab1db9a24cdcb10, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  data:
+  - key: Text
+    gameObject: {fileID: 1173942238304288}
+--- !u!222 &222360589368841156
+CanvasRenderer:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1173942238304288}
+--- !u!222 &222767206446386334
+CanvasRenderer:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1386170326414932}
+--- !u!224 &224438795553994780
+RectTransform:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1386170326414932}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children:
+  - {fileID: 224850331409010544}
+  m_Father: {fileID: 0}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 0, y: 0}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!224 &224850331409010544
+RectTransform:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1173942238304288}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 224438795553994780}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 7, y: 0}
+  m_SizeDelta: {x: 279.3, y: 69.3}
+  m_Pivot: {x: 0.5, y: 0.5}

+ 9 - 0
Unity/Assets/Resources/UI/UILoading.prefab.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 0deea0b3b021a714d8c54816d4ee5fbe
+timeCreated: 1504164637
+licenseType: Free
+NativeFormatImporter:
+  mainObjectFileID: 100100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 6 - 4
Unity/Assets/Scenes/Init.unity

@@ -77,15 +77,17 @@ LightmapSettings:
     m_PVRDirectSampleCount: 32
     m_PVRSampleCount: 500
     m_PVRBounces: 2
-    m_PVRFiltering: 0
+    m_PVRFilterTypeDirect: 0
+    m_PVRFilterTypeIndirect: 0
+    m_PVRFilterTypeAO: 0
     m_PVRFilteringMode: 1
     m_PVRCulling: 1
     m_PVRFilteringGaussRadiusDirect: 1
     m_PVRFilteringGaussRadiusIndirect: 5
     m_PVRFilteringGaussRadiusAO: 2
-    m_PVRFilteringAtrousColorSigma: 1
-    m_PVRFilteringAtrousNormalSigma: 1
-    m_PVRFilteringAtrousPositionSigma: 1
+    m_PVRFilteringAtrousPositionSigmaDirect: 0.5
+    m_PVRFilteringAtrousPositionSigmaIndirect: 2
+    m_PVRFilteringAtrousPositionSigmaAO: 1
   m_LightingDataAsset: {fileID: 0}
   m_UseShadowmask: 0
 --- !u!196 &4

+ 16 - 1
Unity/Assets/Scripts/Base/Config/ConfigHelper.cs

@@ -9,7 +9,8 @@ namespace Model
 		{
 			try
 			{
-				string configStr = ((GameObject) Resources.Load("Config")).Get<TextAsset>(key).text;
+				GameObject config = Game.Scene.GetComponent<ResourcesComponent>().GetAsset<GameObject>("config", "Config");
+				string configStr = config.Get<TextAsset>(key).text;
 				return configStr;
 			}
 			catch (Exception e)
@@ -17,5 +18,19 @@ namespace Model
 				throw new Exception($"load config file fail, key: {key}", e);
 			}
 		}
+		
+		public static string GetGlobal()
+		{
+			try
+			{
+				GameObject config = (GameObject)Resources.Load("KV");
+				string configStr = config.Get<TextAsset>("GlobalProto").text;
+				return configStr;
+			}
+			catch (Exception e)
+			{
+				throw new Exception($"load global config file fail", e);
+			}
+		}
 	}
 }

+ 3 - 0
Unity/Assets/Scripts/Base/Event/EventIdType.cs

@@ -21,5 +21,8 @@
 		MessageDeserializeFinish,
 		SceneChange,
 		FrameUpdate,
+		
+		LoadingBegin,
+		LoadingFinish,
 	}
 }

+ 15 - 0
Unity/Assets/Scripts/Base/Helper/FileHelper.cs

@@ -8,6 +8,21 @@ namespace Model
 {
 	public static class FileHelper
 	{
+		public static void GetAllFiles(List<string> files, string dir)
+		{
+			string[] fls = Directory.GetFiles(dir);
+			foreach (string fl in fls)
+			{
+				files.Add(fl);
+			}
+
+			string[] subDirs = Directory.GetDirectories(dir);
+			foreach (string subDir in subDirs)
+			{
+				GetAllFiles(files, subDir);
+			}
+		}
+		
 		public static void CleanDirectory(string dir)
 		{
 			foreach (string subdir in Directory.GetDirectories(dir))

+ 8 - 1
Unity/Assets/Scripts/Base/Object/Disposer.cs

@@ -10,9 +10,16 @@ namespace Model
 		[BsonElement]
 		[BsonId]
 		public long Id { get; set; }
-		
+	
 		protected Disposer()
 		{
+			this.Id = IdGenerater.GenerateId();
+			ObjectEvents.Instance.Add(this);
+		}
+
+		protected Disposer(long id)
+		{
+			this.Id = id;
 			ObjectEvents.Instance.Add(this);
 		}
 

+ 11 - 2
Unity/Assets/Scripts/Base/Object/Object.cs

@@ -1,6 +1,15 @@
-namespace Model
+using System.ComponentModel;
+
+namespace Model
 {
-	public abstract class Object
+	public abstract class Object: ISupportInitialize
 	{
+		public virtual void BeginInit()
+		{
+		}
+
+		public virtual void EndInit()
+		{
+		}
 	}
 }

+ 33 - 3
Unity/Assets/Scripts/Base/QueueDictionary.cs

@@ -7,17 +7,32 @@ namespace Model
 		private readonly List<T> list = new List<T>();
 		private readonly Dictionary<T, K> dictionary = new Dictionary<T, K>();
 
-		public void Add(T t, K k)
+		public void Enqueue(T t, K k)
 		{
 			this.list.Add(t);
 			this.dictionary.Add(t, k);
 		}
 
-		public bool Remove(T t)
+		public void Dequeue()
+		{
+			if (this.list.Count == 0)
+			{
+				return;
+			}
+			T t = this.list[0];
+			this.list.RemoveAt(0);
+			this.dictionary.Remove(t);
+		}
+
+		public void Remove(T t)
 		{
 			this.list.Remove(t);
 			this.dictionary.Remove(t);
-			return true;
+		}
+
+		public bool ContainsKey(T t)
+		{
+			return this.dictionary.ContainsKey(t);
 		}
 
 		public int Count
@@ -35,6 +50,15 @@ namespace Model
 				return this.list[0];
 			}
 		}
+		
+		public K FirstValue
+		{
+			get
+			{
+				T t = this.list[0];
+				return this[t];
+			}
+		}
 
 		public K this[T t]
 		{
@@ -43,5 +67,11 @@ namespace Model
 				return this.dictionary[t];
 			}
 		}
+
+		public void Clear()
+		{
+			this.list.Clear();
+			this.dictionary.Clear();
+		}
 	}
 }

+ 213 - 0
Unity/Assets/Scripts/Component/BundleDownloaderComponent.cs

@@ -0,0 +1,213 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Model
+{
+	[ObjectEvent]
+	public class UIBundleDownloaderComponentEvent : ObjectEvent<BundleDownloaderComponent>, IAwake
+	{
+		public void Awake()
+		{
+			BundleDownloaderComponent self = this.Get();
+
+			self.bundles = new Queue<string>();
+			self.downloadedBundles = new HashSet<string>();
+			self.downloadingBundle = "";
+		}
+	}
+	
+	/// <summary>
+	/// 用来对比web端的资源,比较md5,对比下载资源
+	/// </summary>
+	public class BundleDownloaderComponent: Component
+	{
+		public VersionConfig VersionConfig { get; private set; }
+
+		public Queue<string> bundles;
+
+		public long TotalSize;
+
+		public HashSet<string> downloadedBundles;
+
+		public string downloadingBundle;
+
+		public UnityWebRequestAsync downloadingRequest;
+
+		public TaskCompletionSource<bool> Tcs;
+
+		public async Task StartAsync()
+		{
+			using (UnityWebRequestAsync request = EntityFactory.Create<UnityWebRequestAsync>())
+			{
+				string versionUrl = GlobalConfigComponent.Instance.GlobalProto.GetUrl() + "StreamingAssets/" + "Version.txt";
+				Log.Debug(versionUrl);
+				await request.DownloadAsync(versionUrl);
+				this.VersionConfig = MongoHelper.FromJson<VersionConfig>(request.Request.downloadHandler.text);
+				Log.Info(MongoHelper.ToJson(this.VersionConfig));
+			}
+			
+			Log.Debug(MongoHelper.ToJson(this.VersionConfig));
+
+			// 对比本地的Version.txt
+			string versionPath = Path.Combine(PathHelper.AppHotfixResPath, "Version.txt");
+			if (!File.Exists(versionPath))
+			{
+				foreach (FileVersionInfo versionInfo in this.VersionConfig.FileVersionInfos)
+				{
+					if(versionInfo.File == "Version.txt")
+					{
+						continue;
+					}
+					this.bundles.Enqueue(versionInfo.File);
+					this.TotalSize += versionInfo.Size;
+				}
+			}
+			else
+			{
+
+				VersionConfig localVersionConfig = MongoHelper.FromJson<VersionConfig>(File.ReadAllText(versionPath));
+				// 先删除服务器端没有的ab
+				foreach (FileVersionInfo fileVersionInfo in localVersionConfig.FileVersionInfos)
+				{
+					if (this.VersionConfig.FileInfoDict.ContainsKey(fileVersionInfo.File))
+					{
+						continue;
+					}
+					string abPath = Path.Combine(PathHelper.AppHotfixResPath, fileVersionInfo.File);
+					File.Delete(abPath);
+				}
+
+				// 再下载
+				foreach (FileVersionInfo fileVersionInfo in this.VersionConfig.FileVersionInfos)
+				{
+					FileVersionInfo localVersionInfo;
+					if (localVersionConfig.FileInfoDict.TryGetValue(fileVersionInfo.File, out localVersionInfo))
+					{
+						if (fileVersionInfo.MD5 == localVersionInfo.MD5)
+						{
+							continue;
+						}
+					}
+
+					if(fileVersionInfo.File == "Version.txt")
+					{
+						continue;
+					}
+					
+					this.bundles.Enqueue(fileVersionInfo.File);
+					this.TotalSize += fileVersionInfo.Size;
+				}
+			}
+			
+			if (this.bundles.Count == 0)
+			{
+				return;
+			}
+
+			Log.Debug($"need download bundles: {this.bundles.ToList().ListToString()}");
+			await this.WaitAsync();
+		}
+
+		private async void UpdateAsync()
+		{
+			while (true)
+			{
+				if (this.bundles.Count == 0)
+				{
+					break;
+				}
+				
+				this.downloadingBundle = this.bundles.Dequeue();
+				
+				while (true)
+				{
+					try
+					{
+						using (this.downloadingRequest = EntityFactory.Create<UnityWebRequestAsync>())
+						{
+							await this.downloadingRequest.DownloadAsync(GlobalConfigComponent.Instance.GlobalProto.GetUrl() + "StreamingAssets/" + this.downloadingBundle);
+							byte[] data = this.downloadingRequest.Request.downloadHandler.data;
+
+							string path = Path.Combine(PathHelper.AppHotfixResPath, this.downloadingBundle);
+							if (!Directory.Exists(Path.GetDirectoryName(path)))
+							{
+								Directory.CreateDirectory(Path.GetDirectoryName(path));
+							}
+							using (FileStream fs = new FileStream(path, FileMode.Create))
+							{
+								fs.Write(data, 0, data.Length);
+							}
+						}
+					}
+					catch(Exception e)
+					{
+						Log.Error($"download bundle error: {this.downloadingBundle}\n{e}");
+						continue;
+					}
+
+					break;
+				}
+				this.downloadedBundles.Add(this.downloadingBundle);
+				this.downloadingBundle = "";
+				this.downloadingRequest = null;
+			}
+
+			using (FileStream fs = new FileStream(Path.Combine(PathHelper.AppHotfixResPath, "Version.txt"), FileMode.Create))
+			using (StreamWriter sw = new StreamWriter(fs))
+			{
+				sw.Write(MongoHelper.ToJson(this.VersionConfig));
+			}
+
+			this.Tcs?.SetResult(true);
+		}
+
+		public int Progress
+		{
+			get
+			{
+				if (this.VersionConfig == null)
+				{
+					return 0;
+				}
+				long alreadyDownloadBytes = 0;
+				foreach (string downloadedBundle in this.downloadedBundles)
+				{
+					long size = this.VersionConfig.FileInfoDict[downloadedBundle].Size;
+					alreadyDownloadBytes += size;
+				}
+				if (this.downloadingRequest != null)
+				{
+					alreadyDownloadBytes += (long)this.downloadingRequest.Request.downloadedBytes;
+				}
+				return (int)(alreadyDownloadBytes * 100f / this.VersionConfig.TotalSize);
+			}
+		}
+
+		private Task<bool> WaitAsync()
+		{
+			if (this.bundles.Count == 0 && this.downloadingBundle == "")
+			{
+				return Task.FromResult(true);
+			}
+			
+			this.Tcs = new TaskCompletionSource<bool>();
+
+			UpdateAsync();
+			
+			return this.Tcs.Task;
+		}
+
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+
+			base.Dispose();
+		}
+	}
+}

+ 3 - 0
Unity/Assets/Scripts/Component/BundleDownloaderComponent.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 1d8fc4d7d4864d01b66efa363af35d88
+timeCreated: 1510746092

+ 21 - 0
Unity/Assets/Scripts/Component/Config/GlobalProto.cs

@@ -0,0 +1,21 @@
+namespace Model
+{
+	public class GlobalProto
+	{
+		public string AssetBundleServerUrl;
+		public string Address;
+
+		public string GetUrl()
+		{
+			string url = this.AssetBundleServerUrl;
+#if UNITY_ANDROID
+			url += "Android/";
+#elif UNITY_IOS
+			url += "IOS/";
+#else
+			url += "PC/";
+#endif
+			return url;
+		}
+	}
+}

+ 3 - 0
Unity/Assets/Scripts/Component/Config/GlobalProto.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: f8c68652f939473db936aa3e8a567548
+timeCreated: 1510746252

+ 24 - 0
Unity/Assets/Scripts/Component/GlobalConfigComponent.cs

@@ -0,0 +1,24 @@
+namespace Model
+{
+	[ObjectEvent]
+	public class GlobalConfigComponentEvent : ObjectEvent<GlobalConfigComponent>, IAwake
+	{
+		public void Awake()
+		{
+			this.Get().Awake();
+		}
+	}
+
+	public class GlobalConfigComponent : Component
+	{
+		public static GlobalConfigComponent Instance;
+		public GlobalProto GlobalProto;
+
+		public void Awake()
+		{
+			Instance = this;
+			string configStr = ConfigHelper.GetGlobal();
+			this.GlobalProto = MongoHelper.FromJson<GlobalProto>(configStr);
+		}
+	}
+}

+ 3 - 0
Unity/Assets/Scripts/Component/GlobalConfigComponent.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 9829f725984449dbb8dac921152a1c26
+timeCreated: 1510746214

+ 236 - 63
Unity/Assets/Scripts/Component/ResourcesComponent.cs

@@ -1,117 +1,286 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
+using System.Linq;
 using System.Threading.Tasks;
 using UnityEngine;
+#if UNITY_EDITOR
+using UnityEditor;
+#endif
 
 namespace Model
 {
-	public class ResourcesComponent: Component
+	public class ABInfo: Disposer
+	{
+		private int refCount;
+		public string Name { get; }
+
+		public int RefCount
+		{
+			get
+			{
+				return this.refCount;
+			}
+			set
+			{
+				Log.Debug($"{this.Name} refcount: {value}");
+				this.refCount = value;
+			}
+		}
+
+		public AssetBundle AssetBundle { get; }
+
+		public ABInfo(string name, AssetBundle ab)
+		{
+			this.Name = name;
+			this.AssetBundle = ab;
+			this.RefCount = 1;
+			Log.Debug($"load assetbundle: {this.Name}");
+		}
+
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+			
+			base.Dispose();
+			
+			Log.Debug($"desdroy assetbundle: {this.Name}");
+			
+			this.AssetBundle?.Unload(true);
+		}
+	}
+
+	public class ResourcesComponent : Component
 	{
 		public static AssetBundleManifest AssetBundleManifestObject { get; set; }
 
 		private readonly Dictionary<string, UnityEngine.Object> resourceCache = new Dictionary<string, UnityEngine.Object>();
 
-		private readonly Dictionary<string, AssetBundle> bundleCaches = new Dictionary<string, AssetBundle>();
+		private readonly Dictionary<string, ABInfo> bundles = new Dictionary<string, ABInfo>();
 		
-		public K GetReference<K>(string bundle, string prefab, string key) where K : class
-		{
-			GameObject gameObject = this.GetAsset<GameObject>(bundle, prefab);
-			return gameObject.GetComponent<ReferenceCollector>().Get<K>(key);
-		}
+		// lru缓存队列
+		private readonly QueueDictionary<string, ABInfo> cacheDictionary = new QueueDictionary<string, ABInfo>();
 
 		public K GetAsset<K>(string bundleName, string prefab) where K : class
 		{
 			string path = $"{bundleName}.unity3d/{prefab}".ToLower();
 
 			UnityEngine.Object resource = null;
-			if (this.resourceCache.TryGetValue(path, out resource))
+			if (!this.resourceCache.TryGetValue(path, out resource))
 			{
-				return resource as K;
+				throw new Exception($"not found asset: {path}");
 			}
 			
-			if (Define.IsAsync)
+			return resource as K;
+		}
+
+		public void UnloadBundle(string assetBundleName)
+		{
+			assetBundleName = assetBundleName.ToLower();
+			
+			this.UnloadOneBundle(assetBundleName);
+
+			string[] dependencies = ResourcesHelper.GetDependencies(assetBundleName);
+
+			//Log.Debug($"-----------dep unload {assetBundleName} dep: {dependencies.ToList().ListToString()}");
+			foreach (string dependency in dependencies)
+			{
+				this.UnloadOneBundle(dependency);
+			}
+		}
+
+		private void UnloadOneBundle(string assetBundleName)
+		{
+			assetBundleName = assetBundleName.ToLower();
+			
+			//Log.Debug($"unload bundle {assetBundleName}");
+			ABInfo abInfo;
+			if (!this.bundles.TryGetValue(assetBundleName, out abInfo))
+			{
+				throw new Exception($"not found assetBundle: {assetBundleName}");
+			}
+
+			--abInfo.RefCount;
+			if (abInfo.RefCount > 0)
+			{
+				return;
+			}
+			
+			
+			this.bundles.Remove(assetBundleName);
+			
+			// 缓存10个包
+			this.cacheDictionary.Enqueue(assetBundleName, abInfo);
+			if (this.cacheDictionary.Count > 10)
+			{
+				abInfo = this.cacheDictionary[this.cacheDictionary.FirstKey];
+				this.cacheDictionary.Dequeue();
+				abInfo.Dispose();
+			}
+			Log.Debug($"cache count: {this.cacheDictionary.Count}");
+		}
+		
+		/// <summary>
+		/// 同步加载assetbundle
+		/// </summary>
+		/// <param name="assetBundleName"></param>
+		/// <returns></returns>
+		public void LoadBundle(string assetBundleName)
+		{
+			assetBundleName = assetBundleName.ToLower();
+			this.LoadOneBundle(assetBundleName);
+
+			string[] dependencies = ResourcesHelper.GetDependencies(assetBundleName);
+
+			Log.Debug($"-----------dep load {assetBundleName} dep: {dependencies.ToList().ListToString()}");
+			foreach (string dependency in dependencies)
 			{
-				if (!this.bundleCaches.ContainsKey($"{bundleName}.unity3d".ToLower()))
+				if (string.IsNullOrEmpty(dependency))
 				{
-					return null;
+					continue;
 				}
+				this.LoadOneBundle(dependency);
+			}
+		}
+		
+		public void LoadOneBundle(string assetBundleName)
+		{
+			ABInfo abInfo;
+			if (this.bundles.TryGetValue(assetBundleName, out abInfo))
+			{
+				++abInfo.RefCount;
+				return;
+			}
 
-				throw new Exception($"异步加载资源,资源不在resourceCache中: {bundleName} {path}");
+
+			if (this.cacheDictionary.ContainsKey(assetBundleName))
+			{
+				abInfo = this.cacheDictionary[assetBundleName];
+				++abInfo.RefCount;
+				this.bundles[assetBundleName] = abInfo;
+				this.cacheDictionary.Remove(assetBundleName);
+				return;
 			}
+			
 
-			try
+			if (!Define.IsAsync)
 			{
-				resource = ResourceHelper.LoadResource(bundleName, prefab);
-				this.resourceCache.Add(path, resource);
+#if UNITY_EDITOR
+				string[] realPath = AssetDatabase.GetAssetPathsFromAssetBundle(assetBundleName);
+				foreach (string s in realPath)
+				{
+					string assetName = Path.GetFileNameWithoutExtension(s);
+					string path = $"{assetBundleName}/{assetName}".ToLower();
+					UnityEngine.Object resource = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(s);
+					this.resourceCache[path] = resource;
+				}
+				
+				this.bundles[assetBundleName] = new ABInfo(assetBundleName, null);
+				return;
+#endif
 			}
-			catch (Exception e)
+
+			AssetBundle assetBundle = AssetBundle.LoadFromFile(Path.Combine(PathHelper.AppResPath, assetBundleName));
+
+			if (!assetBundle.isStreamedSceneAssetBundle)
 			{
-				throw new Exception($"加载资源出错,输入路径:{path}", e);
+				// 异步load资源到内存cache住
+				UnityEngine.Object[] assets = assetBundle.LoadAllAssets();
+				foreach (UnityEngine.Object asset in assets)
+				{
+					string path = $"{assetBundleName}/{asset.name}".ToLower();
+					this.resourceCache[path] = asset;
+				}
 			}
+			
+			this.bundles[assetBundleName] = new ABInfo(assetBundleName, assetBundle);
+		}
 
-			return resource as K;
+		/// <summary>
+		/// 异步加载assetbundle
+		/// </summary>
+		/// <param name="assetBundleName"></param>
+		/// <returns></returns>
+		public async Task LoadBundleAsync(string assetBundleName)
+		{
+			assetBundleName = assetBundleName.ToLower();
+			await this.LoadOneBundleAsync(assetBundleName);
+
+			string[] dependencies = ResourcesHelper.GetDependencies(assetBundleName);
+
+			//Log.Debug($"-----------dep load {assetBundleName} dep: {dependencies.ToList().ListToString()}");
+			foreach (string dependency in dependencies)
+			{
+				if (string.IsNullOrEmpty(dependency))
+				{
+					continue;
+				}
+				await this.LoadOneBundleAsync(dependency);
+			}
 		}
 
-		public async Task DownloadAndCacheAsync(string uri, string assetBundleName)
+		public async Task LoadOneBundleAsync(string assetBundleName)
 		{
-			assetBundleName = (assetBundleName + ".unity3d").ToLower();
+			ABInfo abInfo;
+			if (this.bundles.TryGetValue(assetBundleName, out abInfo))
+			{
+				++abInfo.RefCount;
+				return;
+			}
 
-			AssetBundle assetBundle;
-			// 异步下载资源
-			string url = uri + "StreamingAssets/" + assetBundleName;
-			int count = 0;
-			TimerComponent timerComponent = Game.Scene.GetComponent<TimerComponent>();
-			while (true)
+
+			if (this.cacheDictionary.ContainsKey(assetBundleName))
+			{
+				abInfo = this.cacheDictionary[assetBundleName];
+				++abInfo.RefCount;
+				this.bundles[assetBundleName] = abInfo;
+				this.cacheDictionary.Remove(assetBundleName);
+				return;
+			}
+			
+
+			if (!Define.IsAsync)
 			{
-				using (WWWAsync wwwAsync = new WWWAsync())
+#if UNITY_EDITOR
+				string[] realPath = AssetDatabase.GetAssetPathsFromAssetBundle(assetBundleName);
+				foreach (string s in realPath)
 				{
-					try
-					{ 
-						++count;
-						if (count > 1)
-						{
-							await timerComponent.WaitAsync(1000);
-						}
-
-						if (this.Id == 0)
-						{
-							return;
-						}
-
-						await wwwAsync.LoadFromCacheOrDownload(url, ResourcesComponent.AssetBundleManifestObject.GetAssetBundleHash(assetBundleName));
-						assetBundle = wwwAsync.www.assetBundle;
-
-						break;
-					}
-					catch (Exception e)
-					{
-						Log.Error(e.ToString());
-					}
+					string assetName = Path.GetFileNameWithoutExtension(s);
+					string path = $"{assetBundleName}/{assetName}".ToLower();
+					UnityEngine.Object resource = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(s);
+					this.resourceCache[path] = resource;
 				}
+				
+				this.bundles[assetBundleName] = new ABInfo(assetBundleName, null);
+				return;
+#endif
+			}
+
+			AssetBundle assetBundle;
+			using (AssetsBundleLoaderAsync assetsBundleLoaderAsync = EntityFactory.Create<AssetsBundleLoaderAsync>())
+			{
+				assetBundle = await assetsBundleLoaderAsync.LoadAsync(assetBundleName);
 			}
 
 			if (!assetBundle.isStreamedSceneAssetBundle)
 			{
 				// 异步load资源到内存cache住
 				UnityEngine.Object[] assets;
-				using (AssetBundleLoaderAsync assetBundleLoaderAsync = new AssetBundleLoaderAsync(assetBundle))
-				{ 
-					assets = await assetBundleLoaderAsync.LoadAllAssetsAsync();	
+				using (AssetsLoaderAsync assetsLoaderAsync = EntityFactory.Create<AssetsLoaderAsync, AssetBundle>(assetBundle))
+				{
+					assets = await assetsLoaderAsync.LoadAllAssetsAsync();
 				}
-
-
 				foreach (UnityEngine.Object asset in assets)
 				{
 					string path = $"{assetBundleName}/{asset.name}".ToLower();
 					this.resourceCache[path] = asset;
 				}
 			}
-
-			if (this.bundleCaches.ContainsKey(assetBundleName))
-			{
-				throw new Exception($"重复加载资源: {assetBundleName}");
-			}
-			this.bundleCaches[assetBundleName] = assetBundle;
+			
+			this.bundles[assetBundleName] = new ABInfo(assetBundleName, assetBundle);
 		}
 
 		public override void Dispose()
@@ -123,10 +292,14 @@ namespace Model
 
 			base.Dispose();
 
-			foreach (var assetBundle in bundleCaches)
+			foreach (var abInfo in this.bundles)
 			{
-				assetBundle.Value?.Unload(true);
+				abInfo.Value?.AssetBundle?.Unload(true);
 			}
+			
+			this.bundles.Clear();
+			this.cacheDictionary.Clear();
+			this.resourceCache.Clear();
 		}
 	}
 }

+ 149 - 0
Unity/Assets/Scripts/Component/UIComponent.cs

@@ -0,0 +1,149 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+namespace Model
+{
+	[ObjectEvent]
+	public class UIComponentEvent : ObjectEvent<UIComponent>, IAwake, ILoad
+	{
+		public void Awake()
+		{
+			this.Get().Awake();
+		}
+
+		public void Load()
+		{
+			this.Get().Load();
+		}
+	}
+
+	/// <summary>
+	/// 管理所有UI
+	/// </summary>
+	public class UIComponent: Component
+	{
+		private GameObject Root;
+		private Dictionary<UIType, IUIFactory> UiTypes;
+		private readonly Dictionary<UIType, UI> uis = new Dictionary<UIType, UI>();
+
+		public override void Dispose()
+		{
+			if (Id == 0)
+			{
+				return;
+			}
+
+			base.Dispose();
+
+			foreach (UIType type in uis.Keys.ToArray())
+			{
+				UI ui;
+				if (!uis.TryGetValue(type, out ui))
+				{
+					continue;
+				}
+				uis.Remove(type);
+				ui.Dispose();
+			}
+		}
+
+		public void Awake()
+		{
+			this.Root = GameObject.Find("Global/UI/");
+			this.Load();
+		}
+
+		public void Load()
+		{
+            UiTypes = new Dictionary<UIType, IUIFactory>();
+            
+            Type[] types = DllHelper.GetMonoTypes();
+
+			foreach (Type type in types)
+			{
+				object[] attrs = type.GetCustomAttributes(typeof (UIFactoryAttribute), false);
+				if (attrs.Length == 0)
+				{
+					continue;
+				}
+
+				UIFactoryAttribute attribute = attrs[0] as UIFactoryAttribute;
+				if (UiTypes.ContainsKey((UIType)attribute.Type))
+				{
+                    Log.Debug($"已经存在同类UI Factory: {attribute.Type}");
+					throw new Exception($"已经存在同类UI Factory: {attribute.Type}");
+				}
+				object o = Activator.CreateInstance(type);
+				IUIFactory factory = o as IUIFactory;
+				if (factory == null)
+				{
+					Log.Error($"{o.GetType().FullName} 没有继承 IUIFactory");
+					continue;
+				}
+				this.UiTypes.Add((UIType)attribute.Type, factory);
+			}
+		}
+
+		public UI Create(UIType type)
+		{
+			try
+			{
+				UI ui = UiTypes[type].Create(this.GetEntity<Scene>(), type, Root);
+                uis.Add(type, ui);
+
+				// 设置canvas
+				string cavasName = ui.GameObject.GetComponent<CanvasConfig>().CanvasName;
+				ui.GameObject.transform.SetParent(this.Root.Get<GameObject>(cavasName).transform, false);
+				return ui;
+			}
+			catch (Exception e)
+			{
+				throw new Exception($"{type} UI 错误: {e}");
+			}
+		}
+
+		public void Add(UIType type, UI ui)
+		{
+			this.uis.Add(type, ui);
+		}
+
+		public void Remove(UIType type)
+		{
+			UI ui;
+			if (!uis.TryGetValue(type, out ui))
+			{
+				return;
+			}
+            uis.Remove(type);
+			ui.Dispose();
+		}
+
+		public void RemoveAll()
+		{
+			foreach (UIType type in this.uis.Keys.ToArray())
+			{
+				UI ui;
+				if (!this.uis.TryGetValue(type, out ui))
+				{
+					continue;
+                }
+                this.uis.Remove(type);
+				ui.Dispose();
+			}
+		}
+
+		public UI Get(UIType type)
+		{
+			UI ui;
+			this.uis.TryGetValue(type, out ui);
+			return ui;
+		}
+
+		public List<UIType> GetUITypeList()
+		{
+			return new List<UIType>(this.uis.Keys);
+		}
+	}
+}

+ 12 - 0
Unity/Assets/Scripts/Component/UIComponent.cs.meta

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

+ 49 - 0
Unity/Assets/Scripts/Entity/AssetsBundleLoaderAsync.cs

@@ -0,0 +1,49 @@
+using System.IO;
+using System.Threading.Tasks;
+using UnityEngine;
+
+namespace Model
+{
+	[ObjectEvent]
+	public class AssetsBundleLoaderAsyncEvent : ObjectEvent<AssetsBundleLoaderAsync>, IUpdate
+	{
+		public void Update()
+		{
+			this.Get().Update();
+		}
+	}
+
+	public class AssetsBundleLoaderAsync : Disposer, IUpdate
+	{
+		private AssetBundleCreateRequest request;
+
+		private TaskCompletionSource<AssetBundle> tcs;
+
+		public void Update()
+		{
+			if (!this.request.isDone)
+			{
+				return;
+			}
+
+			TaskCompletionSource<AssetBundle> t = tcs;
+			t.SetResult(this.request.assetBundle);
+		}
+
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+			base.Dispose();
+		}
+
+		public Task<AssetBundle> LoadAsync(string bundleName)
+		{
+			this.tcs = new TaskCompletionSource<AssetBundle>();
+			this.request = AssetBundle.LoadFromFileAsync(Path.Combine(PathHelper.AppHotfixResPath, bundleName));
+			return this.tcs.Task;
+		}
+	}
+}

+ 3 - 0
Unity/Assets/Scripts/Entity/AssetsBundleLoaderAsync.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: f59fcdbebced4076b5c33870f5df3463
+timeCreated: 1510746129

+ 23 - 5
Unity/Assets/Scripts/Entity/AssetBundleLoaderAsync.cs → Unity/Assets/Scripts/Entity/AssetsLoaderAsync.cs

@@ -1,9 +1,24 @@
-using System.Threading.Tasks;
+using System.IO;
+using System.Threading.Tasks;
 using UnityEngine;
 
 namespace Model
 {
-	public class AssetBundleLoaderAsync : Entity
+	[ObjectEvent]
+	public class AssetsLoaderAsyncEvent : ObjectEvent<AssetsLoaderAsync>, IUpdate, IAwake<AssetBundle>
+	{
+		public void Awake(AssetBundle assetBundle)
+		{
+			this.Get().Awake(assetBundle);
+		}
+		
+		public void Update()
+		{
+			this.Get().Update();
+		}
+	}
+
+	public class AssetsLoaderAsync : Disposer, IUpdate
 	{
 		private AssetBundle assetBundle;
 
@@ -11,9 +26,9 @@ namespace Model
 
 		private TaskCompletionSource<bool> tcs;
 
-		public AssetBundleLoaderAsync(AssetBundle assetBundle)
+		public void Awake(AssetBundle ab)
 		{
-			this.assetBundle = assetBundle;
+			this.assetBundle = ab;
 		}
 
 		public void Update()
@@ -23,7 +38,7 @@ namespace Model
 				return;
 			}
 
-			TaskCompletionSource<bool> t = this.tcs;
+			TaskCompletionSource<bool> t = tcs;
 			t.SetResult(true);
 		}
 
@@ -34,6 +49,9 @@ namespace Model
 				return;
 			}
 			base.Dispose();
+
+			this.assetBundle = null;
+			this.request = null;
 		}
 
 		public async Task<UnityEngine.Object[]> LoadAllAssetsAsync()

+ 3 - 0
Unity/Assets/Scripts/Entity/AssetsLoaderAsync.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: f5aab0e13efc491cbae3d11cc8ed42fc
+timeCreated: 1510746129

+ 101 - 0
Unity/Assets/Scripts/Entity/UI.cs

@@ -0,0 +1,101 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Model
+{
+	[ObjectEvent]
+	public class UIEvent : ObjectEvent<UI>, IAwake<Scene, UI, GameObject>
+	{
+		public void Awake(Scene scene, UI parent, GameObject gameObject)
+		{
+			this.Get().Awake(scene, parent, gameObject);
+		}
+	}
+	
+	
+	public sealed class UI: Entity
+	{
+		public Scene Scene { get; set; }
+
+		public string Name
+		{
+			get
+			{
+				return this.GameObject.name;
+			}
+		}
+
+		public GameObject GameObject { get; private set; }
+
+		public Dictionary<string, UI> children = new Dictionary<string, UI>();
+		
+		public void Awake(Scene scene, UI parent, GameObject gameObject)
+		{
+			this.children.Clear();
+			
+			this.Scene = scene;
+
+			if (parent != null)
+			{
+				gameObject.transform.SetParent(parent.GameObject.transform, false);
+			}
+			this.GameObject = gameObject;
+		}
+
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+			
+			base.Dispose();
+
+			foreach (UI ui in this.children.Values)
+			{
+				ui.Dispose();
+			}
+			
+			UnityEngine.Object.Destroy(GameObject);
+			children.Clear();
+		}
+
+		public void SetAsFirstSibling()
+		{
+			this.GameObject.transform.SetAsFirstSibling();
+		}
+
+		public void Add(UI ui)
+		{
+			this.children.Add(ui.Name, ui);
+		}
+
+		public void Remove(string name)
+		{
+			UI ui;
+			if (!this.children.TryGetValue(name, out ui))
+			{
+				return;
+			}
+			this.children.Remove(name);
+			ui.Dispose();
+		}
+
+		public UI Get(string name)
+		{
+			UI child;
+			if (this.children.TryGetValue(name, out child))
+			{
+				return child;
+			}
+			GameObject childGameObject = this.GameObject.transform.Find(name)?.gameObject;
+			if (childGameObject == null)
+			{
+				return null;
+			}
+			child = EntityFactory.Create<UI, Scene, UI, GameObject>(this.Scene, this, childGameObject);
+			this.Add(child);
+			return child;
+		}
+	}
+}

+ 3 - 0
Unity/Assets/Scripts/Entity/UI.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 7dfefa42c5684a1880cca4beccfb8234
+timeCreated: 1510747768

+ 96 - 0
Unity/Assets/Scripts/Entity/UnityWebRequestAsync.cs

@@ -0,0 +1,96 @@
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.Networking;
+
+namespace Model
+{
+	[ObjectEvent]
+	public class UnityWebRequestEvent : ObjectEvent<UnityWebRequestAsync>, IUpdate
+	{
+		public void Update()
+		{
+			this.Get().Update();
+		}
+	}
+	
+	public class UnityWebRequestAsync : Disposer
+	{
+		public UnityWebRequest Request;
+
+		public bool isCancel;
+
+		public TaskCompletionSource<bool> tcs;
+		
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+
+			base.Dispose();
+
+			this.Request?.Dispose();
+			this.Request = null;
+			this.isCancel = false;
+		}
+
+		public float Progress
+		{
+			get
+			{
+				if (this.Request == null)
+				{
+					return 0;
+				}
+				return this.Request.downloadProgress;
+			}
+		}
+
+		public ulong ByteDownloaded
+		{
+			get
+			{
+				if (this.Request == null)
+				{
+					return 0;
+				}
+				return this.Request.downloadedBytes;
+			}
+		}
+
+		public void Update()
+		{
+			if (this.isCancel)
+			{
+				this.tcs.SetResult(false);
+				return;
+			}
+			
+			if (!this.Request.isDone)
+			{
+				return;
+			}
+			if (!string.IsNullOrEmpty(this.Request.error))
+			{
+				this.tcs.SetException(new Exception($"request error: {this.Request.error}"));
+				return;
+			}
+
+			this.tcs.SetResult(true);
+		}
+
+		public Task<bool> DownloadAsync(string url)
+		{
+			this.tcs = new TaskCompletionSource<bool>();
+			
+			url = url.Replace(" ", "%20");
+			this.Request = UnityWebRequest.Get(url);
+			this.Request.Send();
+			
+			return this.tcs.Task;
+		}
+	}
+}

+ 3 - 0
Unity/Assets/Scripts/Entity/UnityWebRequestAsync.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 7de0fad0369a4e589c1ae427717f5b01
+timeCreated: 1510746129

+ 4 - 1
Unity/Assets/Scripts/Factory/UnitFactory.cs

@@ -6,8 +6,11 @@ namespace Model
     {
         public static Unit Create(long id)
         {
+	        ResourcesComponent resourcesComponent = Game.Scene.GetComponent<ResourcesComponent>();
+	        GameObject bundleGameObject = resourcesComponent.GetAsset<GameObject>("Unit", "Unit");
+	        GameObject prefab = bundleGameObject.Get<GameObject>("Skeleton");
+	        
             UnitComponent unitComponent = Game.Scene.GetComponent<UnitComponent>();
-            GameObject prefab = ((GameObject) Resources.Load("Unit")).Get<GameObject>("Skeleton");
             
 	        Unit unit = EntityFactory.CreateWithId<Unit>(id);
 	        unit.GameObject = UnityEngine.Object.Instantiate(prefab);

+ 4 - 0
Unity/Assets/Scripts/Handler/Actor_CreateUnitsHandler.cs

@@ -7,6 +7,10 @@ namespace Model
 	{
 		protected override void Run(Session session, Actor_CreateUnits message)
 		{
+			// 加载Unit资源
+			ResourcesComponent resourcesComponent = Game.Scene.GetComponent<ResourcesComponent>();
+			resourcesComponent.LoadBundle($"Unit.unity3d");
+			
 			UnitComponent unitComponent = Game.Scene.GetComponent<UnitComponent>();
 			
 			foreach (UnitInfo unitInfo in message.Units)

+ 46 - 0
Unity/Assets/Scripts/Helper/BundleHelper.cs

@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using UnityEngine;
+
+namespace Model
+{
+	public static class BundleHelper
+	{
+		public static async Task DownloadBundle()
+		{
+			Game.Scene.GetComponent<EventComponent>().Run(EventIdType.LoadingBegin);
+			await StartDownLoadResources();
+			Game.Scene.GetComponent<EventComponent>().Run(EventIdType.LoadingFinish);
+		}
+		
+		public static async Task StartDownLoadResources()
+		{
+			if (Define.IsAsync)
+			{
+				string url = GlobalConfigComponent.Instance.GlobalProto.GetUrl() + "StreamingAssets/StreamingAssets";
+				try
+				{
+					using (WWWAsync wwwAsync = EntityFactory.Create<WWWAsync>())
+					{
+						await wwwAsync.DownloadAsync(url);
+						ResourcesComponent.AssetBundleManifestObject = wwwAsync.www.assetBundle.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
+						wwwAsync.www.assetBundle.Unload(false);
+					}
+				}
+				catch (Exception e)
+				{
+					Log.Error($"下载错误: {url} {e}");
+					return;
+				}
+				
+				using (BundleDownloaderComponent bundleDownloaderComponent = Game.Scene.AddComponent<BundleDownloaderComponent>())
+				{
+					await bundleDownloaderComponent.StartAsync();
+				}
+			}
+		}
+	}
+}

+ 3 - 0
Unity/Assets/Scripts/Helper/BundleHelper.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 208660418b3f48f4a72b45f5ef6d96a1
+timeCreated: 1510746018

+ 4 - 4
Unity/Assets/Scripts/Helper/DllHelper.cs

@@ -14,9 +14,9 @@ namespace Model
 #if ILRuntime
 		public static void LoadHotfixAssembly()
 		{
-			GameObject code = (GameObject)Resources.Load("Code");
-			byte[] assBytes = code.GetComponent<ReferenceCollector>().Get<TextAsset>("Hotfix.dll").bytes;
-			byte[] mdbBytes = code.GetComponent<ReferenceCollector>().Get<TextAsset>("Hotfix.pdb").bytes;
+			GameObject code = Game.Scene.GetComponent<ResourcesComponent>().GetAsset<GameObject>("code", "Code");
+			byte[] assBytes = code.Get<TextAsset>("Hotfix.dll").bytes;
+			byte[] mdbBytes = code.Get<TextAsset>("Hotfix.pdb").bytes;
 
 			using (MemoryStream fs = new MemoryStream(assBytes))
 			using (MemoryStream p = new MemoryStream(mdbBytes))
@@ -27,7 +27,7 @@ namespace Model
 #else
 		public static Assembly LoadHotfixAssembly()
 		{
-			GameObject code = (GameObject)Resources.Load("Code");
+			GameObject code = Game.Scene.GetComponent<ResourcesComponent>().GetAsset<GameObject>("code", "Code");
 			byte[] assBytes = code.Get<TextAsset>("Hotfix.dll").bytes;
 			byte[] mdbBytes = code.Get<TextAsset>("Hotfix.mdb").bytes;
 			Assembly assembly = Assembly.Load(assBytes, mdbBytes);

+ 1 - 1
Unity/Assets/Scripts/Helper/PathHelp.cs → Unity/Assets/Scripts/Helper/PathHelper.cs

@@ -5,7 +5,7 @@ using UnityEngine;
 
 namespace Model
 {
-    public static class PathHelp
+    public static class PathHelper
     {     /// <summary>
           ///应用程序外部资源路径存放路径(热更新资源路径)
           /// </summary>

+ 0 - 0
Unity/Assets/Scripts/Helper/PathHelp.cs.meta → Unity/Assets/Scripts/Helper/PathHelper.cs.meta


+ 28 - 0
Unity/Assets/Scripts/Helper/ResourcesHelper.cs

@@ -0,0 +1,28 @@
+using System.Threading.Tasks;
+using UnityEngine;
+
+#if UNITY_EDITOR
+using UnityEditor;
+#endif
+
+namespace Model
+{
+	public static class ResourcesHelper
+	{
+		public static string[] GetDependencies(string assetBundleName)
+		{
+			string[] dependencies = new string[0];
+			if (!Define.IsAsync)
+			{
+#if UNITY_EDITOR
+				dependencies = AssetDatabase.GetAssetBundleDependencies(assetBundleName, true);
+#endif
+			}
+			else
+			{
+				dependencies = ResourcesComponent.AssetBundleManifestObject.GetAllDependencies(assetBundleName);
+			}
+			return dependencies;
+		}
+	}
+}

+ 3 - 0
Unity/Assets/Scripts/Helper/ResourcesHelper.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 45c9a2ca2abc43bbab561109c340f827
+timeCreated: 1510746394

+ 30 - 14
Unity/Assets/Scripts/Init.cs

@@ -22,7 +22,7 @@ namespace Model
 		private IStaticMethod lateUpdate;
 		private IStaticMethod onApplicationQuit;
 
-		private void Start()
+		private async void Start()
 		{
 			try
 			{
@@ -37,11 +37,33 @@ namespace Model
 
 				ObjectEvents.Instance.Add("Model", typeof(Init).Assembly);
 
+				Game.Scene.AddComponent<GlobalConfigComponent>();
+				Game.Scene.AddComponent<OpcodeTypeComponent>();
+				Game.Scene.AddComponent<NetOuterComponent>();
+				Game.Scene.AddComponent<ResourcesComponent>();
+				Game.Scene.AddComponent<BehaviorTreeComponent>();
+				Game.Scene.AddComponent<PlayerComponent>();
+				Game.Scene.AddComponent<UnitComponent>();
+				Game.Scene.AddComponent<ClientFrameComponent>();
+				Game.Scene.AddComponent<UIComponent>();
+
+
+				// 下载ab包
+				await BundleHelper.DownloadBundle();
+				
+				// 加载配置
+				Game.Scene.GetComponent<ResourcesComponent>().LoadBundle("config.unity3d");
+				Game.Scene.AddComponent<ConfigComponent>();
+				Game.Scene.GetComponent<ResourcesComponent>().UnloadBundle("config.unity3d");
+				
+				Game.Scene.AddComponent<MessageDispatherComponent>();
 #if ILRuntime
 				Log.Debug("run in ilruntime mode");
 
 				this.AppDomain = new ILRuntime.Runtime.Enviorment.AppDomain();
+				Game.Scene.GetComponent<ResourcesComponent>().LoadBundle($"code.unity3d");
 				ObjectEvents.Instance.LoadHotfixDll();
+				Game.Scene.GetComponent<ResourcesComponent>().UnloadBundle($"code.unity3d");
 				ILHelper.InitILRuntime();
 				
 				this.start = new ILStaticMethod("Hotfix.Init", "Start", 0);
@@ -50,7 +72,9 @@ namespace Model
 				this.onApplicationQuit = new ILStaticMethod("Hotfix.Init", "OnApplicationQuit", 0);
 #else
 				Log.Debug("run in mono mode");
+				Game.Scene.GetComponent<ResourcesComponent>().LoadBundle($"code.unity3d");
 				ObjectEvents.Instance.LoadHotfixDll();
+				Game.Scene.GetComponent<ResourcesComponent>().UnloadBundle($"code.unity3d");
 				Type hotfixInit = ObjectEvents.Instance.HotfixAssembly.GetType("Hotfix.Init");
 				this.start = new MonoStaticMethod(hotfixInit, "Start");
 				this.update = new MonoStaticMethod(hotfixInit, "Update");
@@ -58,18 +82,10 @@ namespace Model
 				this.onApplicationQuit = new MonoStaticMethod(hotfixInit, "OnApplicationQuit");
 #endif
 
-				Game.Scene.AddComponent<OpcodeTypeComponent>();
-				Game.Scene.AddComponent<MessageDispatherComponent>();
-				Game.Scene.AddComponent<NetOuterComponent>();
-				Game.Scene.AddComponent<ResourcesComponent>();
-				Game.Scene.AddComponent<BehaviorTreeComponent>();
-				Game.Scene.AddComponent<ConfigComponent>();
-				Game.Scene.AddComponent<PlayerComponent>();
-				Game.Scene.AddComponent<UnitComponent>();
-				Game.Scene.AddComponent<ClientFrameComponent>();
-
 				// 进入热更新层
 				this.start.Run();
+				
+				Game.Scene.GetComponent<EventComponent>().Run(EventIdType.InitSceneStart);
 			}
 			catch (Exception e)
 			{
@@ -79,13 +95,13 @@ namespace Model
 
 		private void Update()
 		{
-			this.update.Run();
+			this.update?.Run();
 			ObjectEvents.Instance.Update();
 		}
 
 		private void LateUpdate()
 		{
-			this.lateUpdate.Run();
+			this.lateUpdate?.Run();
 			ObjectEvents.Instance.LateUpdate();
 		}
 
@@ -94,7 +110,7 @@ namespace Model
 			Instance = null;
 			Game.Close();
 			ObjectEvents.Close();
-			this.onApplicationQuit.Run();
+			this.onApplicationQuit?.Run();
 		}
 	}
 }

+ 10 - 0
Unity/Assets/Scripts/Other/IUIFactory.cs

@@ -0,0 +1,10 @@
+using UnityEngine;
+
+namespace Model
+{
+	public interface IUIFactory
+	{
+		UI Create(Scene scene, UIType type, GameObject parent);
+		void Remove(UIType type);
+	}
+}

+ 12 - 0
Unity/Assets/Scripts/Other/IUIFactory.cs.meta

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

+ 1 - 1
Unity/Hotfix/Base/Other/UIFactoryAttribute.cs → Unity/Assets/Scripts/Other/UIFactoryAttribute.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace Hotfix
+namespace Model
 {
 	[AttributeUsage(AttributeTargets.Class)]
 	public class UIFactoryAttribute: Attribute

+ 12 - 0
Unity/Assets/Scripts/Other/UIFactoryAttribute.cs.meta

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

+ 10 - 0
Unity/Assets/Scripts/Other/UIType.cs

@@ -0,0 +1,10 @@
+namespace Model
+{
+    public enum UIType
+    {
+        Root = 0,
+        UILogin,
+		UILobby,
+	    UILoading,
+	}
+}

+ 12 - 0
Unity/Assets/Scripts/Other/UIType.cs.meta

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

+ 3 - 0
Unity/Assets/Scripts/UI.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: e7f5a5568a0542eebf0a3b3754a528b9
+timeCreated: 1510747624

+ 3 - 0
Unity/Assets/Scripts/UI/UILoading.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 1aa1f5ecf51a49d7917db724be4bd7b0
+timeCreated: 1510747627

+ 3 - 0
Unity/Assets/Scripts/UI/UILoading/Component.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 9ac25f3157c14a3caac468fb7971aab4
+timeCreated: 1510747627

+ 44 - 0
Unity/Assets/Scripts/UI/UILoading/Component/UILoadingComponent.cs

@@ -0,0 +1,44 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Model
+{
+	[ObjectEvent]
+	public class UILoadingComponentEvent : ObjectEvent<UILoadingComponent>, IAwake, IStart
+	{
+		public void Awake()
+		{
+			UILoadingComponent self = this.Get();
+			self.text = self.GetEntity<UI>().GameObject.Get<GameObject>("Text").GetComponent<Text>();
+		}
+
+		public async void Start()
+		{
+			UILoadingComponent self = this.Get();
+
+			TimerComponent timerComponent = Game.Scene.GetComponent<TimerComponent>();
+			
+			while (true)
+			{
+				await timerComponent.WaitAsync(1000);
+				
+				if (self.Id == 0)
+				{
+					return;
+				}
+
+				BundleDownloaderComponent bundleDownloaderComponent = Game.Scene.GetComponent<BundleDownloaderComponent>();
+				if (bundleDownloaderComponent == null)
+				{
+					continue;
+				}
+				self.text.text = $"{bundleDownloaderComponent.Progress}%";
+			}
+		}
+	}
+	
+	public class UILoadingComponent : Component
+	{
+		public Text text;
+	}
+}

+ 3 - 0
Unity/Assets/Scripts/UI/UILoading/Component/UILoadingComponent.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: cc5b857b227647faa2beb1b58ae63d7d
+timeCreated: 1510747627

+ 9 - 0
Unity/Assets/Scripts/UI/UILoading/Event.meta

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

+ 11 - 0
Unity/Assets/Scripts/UI/UILoading/Event/LoadingBeginEvent_CreateLoadingUI.cs

@@ -0,0 +1,11 @@
+namespace Model
+{
+    [Event((int)EventIdType.LoadingBegin)]
+    public class LoadingBeginEvent_CreateLoadingUI : IEvent
+    {
+        public void Run()
+        {
+			Game.Scene.GetComponent<UIComponent>().Create(UIType.UILoading);
+        }
+    }
+}

+ 12 - 0
Unity/Assets/Scripts/UI/UILoading/Event/LoadingBeginEvent_CreateLoadingUI.cs.meta

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

+ 11 - 0
Unity/Assets/Scripts/UI/UILoading/Event/LoadingFinishEvent_RemoveLoadingUI.cs

@@ -0,0 +1,11 @@
+namespace Model
+{
+    [Event((int)EventIdType.LoadingFinish)]
+    public class LoadingFinishEvent_RemoveLoadingUI : IEvent
+    {
+        public void Run()
+        {
+			Game.Scene.GetComponent<UIComponent>().Remove(UIType.UILoading);
+        }
+    }
+}

+ 12 - 0
Unity/Assets/Scripts/UI/UILoading/Event/LoadingFinishEvent_RemoveLoadingUI.cs.meta

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

+ 3 - 0
Unity/Assets/Scripts/UI/UILoading/Factory.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 23e2bee9b88d47aaaf1719ff6e00a06b
+timeCreated: 1510747627

+ 32 - 0
Unity/Assets/Scripts/UI/UILoading/Factory/UILoadingFactory.cs

@@ -0,0 +1,32 @@
+using System;
+using UnityEngine;
+
+namespace Model
+{
+    [UIFactory((int)UIType.UILoading)]
+    public class UILoadingFactory : IUIFactory
+    {
+        public UI Create(Scene scene, UIType type, GameObject gameObject)
+        {
+	        try
+	        {
+				GameObject bundleGameObject = ((GameObject)Resources.Load("KV")).Get<GameObject>("UILoading");
+				GameObject go = UnityEngine.Object.Instantiate(bundleGameObject);
+				go.layer = LayerMask.NameToLayer(LayerNames.UI);
+				UI ui = EntityFactory.Create<UI, Scene, UI, GameObject>(scene, null, go);
+
+				ui.AddComponent<UILoadingComponent>();
+				return ui;
+	        }
+	        catch (Exception e)
+	        {
+				Log.Error(e.ToString());
+		        return null;
+	        }
+		}
+
+	    public void Remove(UIType type)
+	    {
+	    }
+    }
+}

+ 3 - 0
Unity/Assets/Scripts/UI/UILoading/Factory/UILoadingFactory.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: ad4368dbb51741b6a58fb499afe5b905
+timeCreated: 1510747627

+ 1 - 0
Unity/Hotfix/Base/Other/IUIFactory.cs

@@ -6,5 +6,6 @@ namespace Hotfix
 	public interface IUIFactory
 	{
 		UI Create(Scene scene, UIType type, GameObject parent);
+		void Remove(UIType type);
 	}
 }

+ 0 - 9
Unity/Hotfix/Base/Other/UIType.cs

@@ -1,9 +0,0 @@
-namespace Hotfix
-{
-    public enum UIType
-    {
-        Root = 0,
-        Login,
-		Lobby,
-    }
-}

+ 0 - 1
Unity/Hotfix/Init.cs

@@ -11,7 +11,6 @@ namespace Hotfix
 			{
 				Hotfix.Scene.ModelScene = Game.Scene;
 				Hotfix.Scene.AddComponent<UIComponent>();
-				Game.Scene.GetComponent<EventComponent>().Run(EventIdType.InitSceneStart);
 			}
 			catch (Exception e)
 			{

+ 1 - 1
Unity/Hotfix/UI/UILobby/Component/UILobbyComponent.cs

@@ -82,7 +82,7 @@ namespace Hotfix
 			try
 			{
 				G2C_EnterMap g2CEnterMap = await SessionComponent.Instance.Session.Call<G2C_EnterMap>(new C2G_EnterMap());
-				Hotfix.Scene.GetComponent<UIComponent>().Remove(UIType.Lobby);
+				Hotfix.Scene.GetComponent<UIComponent>().Remove(UIType.UILobby);
 			}
 			catch (Exception e)
 			{

+ 9 - 2
Unity/Hotfix/UI/UILobby/Factory/UILobbyFactory.cs

@@ -4,14 +4,16 @@ using UnityEngine;
 
 namespace Hotfix
 {
-    [UIFactory((int)UIType.Lobby)]
+    [UIFactory((int)UIType.UILobby)]
     public class UILobbyFactory : IUIFactory
     {
         public UI Create(Scene scene, UIType type, GameObject gameObject)
         {
 	        try
 	        {
-				GameObject bundleGameObject = ((GameObject)Resources.Load("UI")).Get<GameObject>("UILobby");
+				ResourcesComponent resourcesComponent = Game.Scene.GetComponent<ResourcesComponent>();
+		        resourcesComponent.LoadBundle($"{type}.unity3d");
+				GameObject bundleGameObject = resourcesComponent.GetAsset<GameObject>($"{type}", $"{type}");
 				GameObject lobby = UnityEngine.Object.Instantiate(bundleGameObject);
 				lobby.layer = LayerMask.NameToLayer(LayerNames.UI);
 				UI ui = EntityFactory.Create<UI, Scene, UI, GameObject>(scene, null, lobby);
@@ -25,5 +27,10 @@ namespace Hotfix
 		        return null;
 	        }
 		}
+
+	    public void Remove(UIType type)
+	    {
+		    Game.Scene.GetComponent<ResourcesComponent>().UnloadBundle($"{type}.unity3d");
+		}
     }
 }

+ 3 - 3
Unity/Hotfix/UI/UILogin/Component/UILoginComponent.cs

@@ -33,7 +33,7 @@ namespace Hotfix
 			Session session = null;
 			try
 			{
-				session = Hotfix.Scene.ModelScene.GetComponent<NetOuterComponent>().Create("127.0.0.1:10002");
+				session = Hotfix.Scene.ModelScene.GetComponent<NetOuterComponent>().Create(GlobalConfigComponent.Instance.GlobalProto.Address);
 				string text = this.account.GetComponent<InputField>().text;
 				R2C_Login r2CLogin = await session.Call<R2C_Login>(new C2R_Login() { Account = text, Password = "111111" });
 				Session gateSession = Hotfix.Scene.ModelScene.GetComponent<NetOuterComponent>().Create(r2CLogin.Address);
@@ -47,8 +47,8 @@ namespace Hotfix
 				PlayerComponent playerComponent = Game.Scene.GetComponent<PlayerComponent>();
 				playerComponent.MyPlayer = player;
 
-				Hotfix.Scene.GetComponent<UIComponent>().Create(UIType.Lobby);
-				Hotfix.Scene.GetComponent<UIComponent>().Remove(UIType.Login);
+				Hotfix.Scene.GetComponent<UIComponent>().Create(UIType.UILobby);
+				Hotfix.Scene.GetComponent<UIComponent>().Remove(UIType.UILogin);
 			}
 			catch (Exception e)
 			{

+ 1 - 1
Unity/Hotfix/UI/UILogin/Event/InitSceneStart_CreateLoginUI.cs

@@ -7,7 +7,7 @@ namespace Hotfix
 	{
 		public void Run()
 		{
-			UI ui = Hotfix.Scene.GetComponent<UIComponent>().Create(UIType.Login);
+			UI ui = Hotfix.Scene.GetComponent<UIComponent>().Create(UIType.UILogin);
 		}
 	}
 }

+ 10 - 3
Unity/Hotfix/UI/UILogin/Factory/UILoginFactory.cs

@@ -4,14 +4,16 @@ using UnityEngine;
 
 namespace Hotfix
 {
-    [UIFactory((int)UIType.Login)]
+    [UIFactory((int)UIType.UILogin)]
     public class UILoginFactory : IUIFactory
     {
         public UI Create(Scene scene, UIType type, GameObject gameObject)
         {
 	        try
-	        {
-				GameObject bundleGameObject = ((GameObject)Resources.Load("UI")).Get<GameObject>("UILogin");
+			{
+				ResourcesComponent resourcesComponent = Game.Scene.GetComponent<ResourcesComponent>();
+				resourcesComponent.LoadBundle($"{type}.unity3d");
+				GameObject bundleGameObject = resourcesComponent.GetAsset<GameObject>($"{type}", $"{type}");
 				GameObject login = UnityEngine.Object.Instantiate(bundleGameObject);
 				login.layer = LayerMask.NameToLayer(LayerNames.UI);
 		        UI ui = EntityFactory.Create<UI, Scene, UI, GameObject>(scene, null, login);
@@ -25,5 +27,10 @@ namespace Hotfix
 		        return null;
 	        }
 		}
+
+	    public void Remove(UIType type)
+	    {
+			Game.Scene.GetComponent<ResourcesComponent>().UnloadBundle($"{type}.unity3d");
+	    }
     }
 }

+ 4 - 4
Unity/Hotfix/Unity.Hotfix.csproj

@@ -35,10 +35,12 @@
     <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Assembly-CSharp">
+    <Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
       <HintPath>..\Library\ScriptAssemblies\Assembly-CSharp.dll</HintPath>
     </Reference>
-    <Reference Include="Assembly-CSharp-firstpass">
+    <Reference Include="Assembly-CSharp-firstpass, Version=2.0.0.668, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
       <HintPath>..\Library\ScriptAssemblies\Assembly-CSharp-firstpass.dll</HintPath>
     </Reference>
     <Reference Include="System" />
@@ -76,8 +78,6 @@
     <Compile Include="Base\Object\ObjectEvents.cs" />
     <Compile Include="Base\Object\ObjectPool.cs" />
     <Compile Include="Base\Other\IUIFactory.cs" />
-    <Compile Include="Base\Other\UIFactoryAttribute.cs" />
-    <Compile Include="Base\Other\UIType.cs" />
     <Compile Include="Component\UIComponent.cs" />
     <Compile Include="Entity\Hotfix.cs" />
     <Compile Include="Entity\Scene.cs" />

+ 1 - 0
Unity/ProjectSettings/ProjectSettings.asset

@@ -240,6 +240,7 @@ PlayerSettings:
       m_Icon: {fileID: 0}
       m_Width: 128
       m_Height: 128
+      m_Kind: 0
   m_BuildTargetBatching: []
   m_BuildTargetGraphicsAPIs:
   - m_BuildTarget: AndroidPlayer

+ 1 - 1
Unity/ProjectSettings/ProjectVersion.txt

@@ -1 +1 @@
-m_EditorVersion: 2017.1.0p5
+m_EditorVersion: 2017.1.1p4

+ 4 - 5
Unity/Unity.Editor.Plugins.csproj

@@ -15,7 +15,7 @@
     <TargetFrameworkProfile></TargetFrameworkProfile>
     <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectType>EditorPlugins:7</UnityProjectType>
-    <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
+    <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.1.1p4</UnityVersion>
     <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
@@ -32,7 +32,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -42,7 +42,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
+    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
@@ -163,9 +163,8 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Assets\Res\Config\BuffConfig.txt" />
+    <None Include="Assets\Res\Config\GlobalProto.txt" />
     <None Include="Assets\Res\Config\UnitConfig.txt" />
-    <None Include="Assets\StreamingAssets\Logs\Log-Client-Error.txt" />
-    <None Include="Assets\StreamingAssets\Logs\Log-Client-Info.txt" />
     <None Include="Assets\link.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 6 - 6
Unity/Unity.Editor.csproj

@@ -15,7 +15,7 @@
     <TargetFrameworkProfile></TargetFrameworkProfile>
     <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectType>Editor:5</UnityProjectType>
-    <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
+    <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.1.1p4</UnityVersion>
     <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
@@ -32,7 +32,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -42,7 +42,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
+    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
@@ -201,10 +201,11 @@
     <Compile Include="Assets\Editor\BehaviorTreeEditor\NodeMeta.cs" />
     <Compile Include="Assets\Editor\BehaviorTreeEditor\NodeMetaHelper.cs" />
     <Compile Include="Assets\Editor\BehaviorTreeEditor\PropertyDesigner.cs" />
-    <Compile Include="Assets\Editor\BuildEditor\BuildABEditor.cs" />
     <Compile Include="Assets\Editor\BuildEditor\BuildEditor.cs" />
+    <Compile Include="Assets\Editor\BuildEditor\BuildHelper.cs" />
     <Compile Include="Assets\Editor\ExcelExporterEditor\ExcelExporterEditor.cs" />
     <Compile Include="Assets\Editor\ExportNavmesh.cs" />
+    <Compile Include="Assets\Editor\GlobalConfigEditor\GlobalConfigEditor.cs" />
     <Compile Include="Assets\Editor\Helper\EditorResHelper.cs" />
     <Compile Include="Assets\Editor\ReferenceCollectorEditor\ReferenceCollectorEditor.cs" />
     <Compile Include="Assets\Editor\RsyncEditor\RsyncConfig.cs" />
@@ -213,9 +214,8 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Assets\Res\Config\BuffConfig.txt" />
+    <None Include="Assets\Res\Config\GlobalProto.txt" />
     <None Include="Assets\Res\Config\UnitConfig.txt" />
-    <None Include="Assets\StreamingAssets\Logs\Log-Client-Error.txt" />
-    <None Include="Assets\StreamingAssets\Logs\Log-Client-Info.txt" />
     <None Include="Assets\link.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 4 - 5
Unity/Unity.Plugins.csproj

@@ -15,7 +15,7 @@
     <TargetFrameworkProfile></TargetFrameworkProfile>
     <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectType>GamePlugins:3</UnityProjectType>
-    <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
+    <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.1.1p4</UnityVersion>
     <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
@@ -32,7 +32,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -42,7 +42,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
+    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
@@ -515,9 +515,8 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Assets\Res\Config\BuffConfig.txt" />
+    <None Include="Assets\Res\Config\GlobalProto.txt" />
     <None Include="Assets\Res\Config\UnitConfig.txt" />
-    <None Include="Assets\StreamingAssets\Logs\Log-Client-Error.txt" />
-    <None Include="Assets\StreamingAssets\Logs\Log-Client-Info.txt" />
     <None Include="Assets\link.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 22 - 7
Unity/Unity.csproj

@@ -15,7 +15,7 @@
     <TargetFrameworkProfile></TargetFrameworkProfile>
     <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectType>Game:1</UnityProjectType>
-    <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
+    <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.1.1p4</UnityVersion>
     <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
@@ -32,7 +32,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -42,7 +42,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
+    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_1;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;NET45</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
@@ -263,10 +263,12 @@
     <Compile Include="Assets\Scripts\BehaviorTreeNode\UIScale.cs" />
     <Compile Include="Assets\Scripts\Component\AnimatorComponent.cs" />
     <Compile Include="Assets\Scripts\Component\BehaviorTreeComponent.cs" />
+    <Compile Include="Assets\Scripts\Component\BundleDownloaderComponent.cs" />
     <Compile Include="Assets\Scripts\Component\CameraComponent.cs" />
     <Compile Include="Assets\Scripts\Component\ClientFrameComponent.cs" />
     <Compile Include="Assets\Scripts\Component\Config\ClientConfig.cs" />
     <Compile Include="Assets\Scripts\Component\Config\DBConfig.cs" />
+    <Compile Include="Assets\Scripts\Component\Config\GlobalProto.cs" />
     <Compile Include="Assets\Scripts\Component\Config\HttpConfig.cs" />
     <Compile Include="Assets\Scripts\Component\Config\InnerConfig.cs" />
     <Compile Include="Assets\Scripts\Component\Config\OuterConfig.cs" />
@@ -275,6 +277,7 @@
     <Compile Include="Assets\Scripts\Component\Config\VersionConfig.cs" />
     <Compile Include="Assets\Scripts\Component\ConfigComponent.cs" />
     <Compile Include="Assets\Scripts\Component\EventComponent.cs" />
+    <Compile Include="Assets\Scripts\Component\GlobalConfigComponent.cs" />
     <Compile Include="Assets\Scripts\Component\MessageDispatherComponent.cs" />
     <Compile Include="Assets\Scripts\Component\MoveComponent.cs" />
     <Compile Include="Assets\Scripts\Component\NetOuterComponent.cs" />
@@ -288,8 +291,10 @@
     <Compile Include="Assets\Scripts\Component\SceneChangeComponent.cs" />
     <Compile Include="Assets\Scripts\Component\SessionComponent.cs" />
     <Compile Include="Assets\Scripts\Component\TimerComponent.cs" />
+    <Compile Include="Assets\Scripts\Component\UIComponent.cs" />
     <Compile Include="Assets\Scripts\Component\UnitComponent.cs" />
-    <Compile Include="Assets\Scripts\Entity\AssetBundleLoaderAsync.cs" />
+    <Compile Include="Assets\Scripts\Entity\AssetsBundleLoaderAsync.cs" />
+    <Compile Include="Assets\Scripts\Entity\AssetsLoaderAsync.cs" />
     <Compile Include="Assets\Scripts\Entity\Config\BuffConfig.cs" />
     <Compile Include="Assets\Scripts\Entity\Config\UnitConfig.cs" />
     <Compile Include="Assets\Scripts\Entity\Game.cs" />
@@ -298,7 +303,9 @@
     <Compile Include="Assets\Scripts\Entity\Player.cs" />
     <Compile Include="Assets\Scripts\Entity\Scene.cs" />
     <Compile Include="Assets\Scripts\Entity\Session.cs" />
+    <Compile Include="Assets\Scripts\Entity\UI.cs" />
     <Compile Include="Assets\Scripts\Entity\Unit.cs" />
+    <Compile Include="Assets\Scripts\Entity\UnityWebRequestAsync.cs" />
     <Compile Include="Assets\Scripts\Entity\WWWAsync.cs" />
     <Compile Include="Assets\Scripts\Event\NumericChangeEvent_NotifyWatcher.cs" />
     <Compile Include="Assets\Scripts\Event\NumericWatcher_Hp_ShowUI.cs" />
@@ -308,23 +315,32 @@
     <Compile Include="Assets\Scripts\Handler\Actor_TestHandler.cs" />
     <Compile Include="Assets\Scripts\Handler\Frame_ClickMapHandler.cs" />
     <Compile Include="Assets\Scripts\Helper\ActionHelper.cs" />
+    <Compile Include="Assets\Scripts\Helper\BundleHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\DllHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\GameObjectHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\ILHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\MongoHelper.cs" />
-    <Compile Include="Assets\Scripts\Helper\PathHelp.cs" />
+    <Compile Include="Assets\Scripts\Helper\PathHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\PositionHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\ResourceHelper.cs" />
+    <Compile Include="Assets\Scripts\Helper\ResourcesHelper.cs" />
     <Compile Include="Assets\Scripts\Init.cs" />
     <Compile Include="Assets\Scripts\MonoConfig\CanvasConfig.cs" />
     <Compile Include="Assets\Scripts\Other\Define.cs" />
     <Compile Include="Assets\Scripts\Other\IInstanceMethod.cs" />
     <Compile Include="Assets\Scripts\Other\ILMethod.cs" />
     <Compile Include="Assets\Scripts\Other\INumericWatcher.cs" />
+    <Compile Include="Assets\Scripts\Other\IUIFactory.cs" />
     <Compile Include="Assets\Scripts\Other\MonoMethod.cs" />
     <Compile Include="Assets\Scripts\Other\MotionType.cs" />
     <Compile Include="Assets\Scripts\Other\NumericWatcherAttribute.cs" />
     <Compile Include="Assets\Scripts\Other\ReferenceCollector.cs" />
+    <Compile Include="Assets\Scripts\Other\UIFactoryAttribute.cs" />
+    <Compile Include="Assets\Scripts\Other\UIType.cs" />
+    <Compile Include="Assets\Scripts\UI\UILoading\Component\UILoadingComponent.cs" />
+    <Compile Include="Assets\Scripts\UI\UILoading\Event\LoadingBeginEvent_CreateLoadingUI.cs" />
+    <Compile Include="Assets\Scripts\UI\UILoading\Event\LoadingFinishEvent_RemoveLoadingUI.cs" />
+    <Compile Include="Assets\Scripts\UI\UILoading\Factory\UILoadingFactory.cs" />
     <Compile Include="Assets\ThirdParty\ILRuntime\ILRuntime\CLR\Method\CLRMethod.cs" />
     <Compile Include="Assets\ThirdParty\ILRuntime\ILRuntime\CLR\Method\ExceptionHandler.cs" />
     <Compile Include="Assets\ThirdParty\ILRuntime\ILRuntime\CLR\Method\ILMethod.cs" />
@@ -551,9 +567,8 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Assets\Res\Config\BuffConfig.txt" />
+    <None Include="Assets\Res\Config\GlobalProto.txt" />
     <None Include="Assets\Res\Config\UnitConfig.txt" />
-    <None Include="Assets\StreamingAssets\Logs\Log-Client-Error.txt" />
-    <None Include="Assets\StreamingAssets\Logs\Log-Client-Info.txt" />
     <None Include="Assets\link.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />