Browse Source

客户端增加两个程序集 ModelView跟HotfixView,目前客户端共有5个程序集,其作用如下
1.Model 逻辑层数据结构定义
2.Hotfix 逻辑层的逻辑方法
3.ModelView 显示层的数据结构定义
4.HotfixView 显示层的逻辑方法
5.ThirdParty 第三方库
为什么要分出ModelView跟HotfixView呢?主要原因是要分离显示层跟逻辑层,逻辑层的代码其实可以用来做压测机器人。如果一开始就定好这样的结构,压测机器人完全可以利用客户端逻辑层的代码,节省大量时间

tanghai 6 years ago
parent
commit
020b944bf3
100 changed files with 471 additions and 279 deletions
  1. 30 0
      Client-Server.sln
  2. 11 3
      Unity/Assets/Editor/Unity.Editor.asmdef
  3. 1 1
      Unity/Assets/HotfixView.meta
  4. 1 1
      Unity/Assets/HotfixView/Demo.meta
  5. 15 0
      Unity/Assets/HotfixView/Demo/GlobalConfigComponentSystem.cs
  6. 11 0
      Unity/Assets/HotfixView/Demo/GlobalConfigComponentSystem.cs.meta
  7. 1 1
      Unity/Assets/HotfixView/Demo/UI.meta
  8. 1 1
      Unity/Assets/HotfixView/Demo/UI/UILoading.meta
  9. 0 0
      Unity/Assets/HotfixView/Demo/UI/UILoading/LoadingBeginEvent_CreateLoadingUI.cs
  10. 2 3
      Unity/Assets/HotfixView/Demo/UI/UILoading/LoadingBeginEvent_CreateLoadingUI.cs.meta
  11. 0 0
      Unity/Assets/HotfixView/Demo/UI/UILoading/LoadingFinishEvent_RemoveLoadingUI.cs
  12. 2 3
      Unity/Assets/HotfixView/Demo/UI/UILoading/LoadingFinishEvent_RemoveLoadingUI.cs.meta
  13. 46 0
      Unity/Assets/HotfixView/Demo/UI/UILoading/UILoadingComponentSystem.cs
  14. 11 0
      Unity/Assets/HotfixView/Demo/UI/UILoading/UILoadingComponentSystem.cs.meta
  15. 0 0
      Unity/Assets/HotfixView/Demo/UI/UILoading/UILoadingFactory.cs
  16. 1 1
      Unity/Assets/HotfixView/Demo/UI/UILoading/UILoadingFactory.cs.meta
  17. 8 0
      Unity/Assets/HotfixView/Demo/UI/UILobby.meta
  18. 0 0
      Unity/Assets/HotfixView/Demo/UI/UILobby/EnterMapFinish_RemoveLobbyUI.cs
  19. 1 1
      Unity/Assets/HotfixView/Demo/UI/UILobby/EnterMapFinish_RemoveLobbyUI.cs.meta
  20. 0 0
      Unity/Assets/HotfixView/Demo/UI/UILobby/LoginFinish_CreateLobbyUI.cs
  21. 1 1
      Unity/Assets/HotfixView/Demo/UI/UILobby/LoginFinish_CreateLobbyUI.cs.meta
  22. 26 0
      Unity/Assets/HotfixView/Demo/UI/UILobby/UILobbyComponentSystem.cs
  23. 11 0
      Unity/Assets/HotfixView/Demo/UI/UILobby/UILobbyComponentSystem.cs.meta
  24. 0 0
      Unity/Assets/HotfixView/Demo/UI/UILobby/UILobbyFactory.cs
  25. 1 1
      Unity/Assets/HotfixView/Demo/UI/UILobby/UILobbyFactory.cs.meta
  26. 8 0
      Unity/Assets/HotfixView/Demo/UI/UILogin.meta
  27. 0 0
      Unity/Assets/HotfixView/Demo/UI/UILogin/InitSceneStart_CreateLoginUI.cs
  28. 1 1
      Unity/Assets/HotfixView/Demo/UI/UILogin/InitSceneStart_CreateLoginUI.cs.meta
  29. 0 0
      Unity/Assets/HotfixView/Demo/UI/UILogin/LoginFinish_RemoveLoginUI.cs
  30. 1 1
      Unity/Assets/HotfixView/Demo/UI/UILogin/LoginFinish_RemoveLoginUI.cs.meta
  31. 28 0
      Unity/Assets/HotfixView/Demo/UI/UILogin/UILoginComponentSystem.cs
  32. 11 0
      Unity/Assets/HotfixView/Demo/UI/UILogin/UILoginComponentSystem.cs.meta
  33. 0 0
      Unity/Assets/HotfixView/Demo/UI/UILogin/UILoginFactory.cs
  34. 1 1
      Unity/Assets/HotfixView/Demo/UI/UILogin/UILoginFactory.cs.meta
  35. 8 0
      Unity/Assets/HotfixView/Demo/Unit.meta
  36. 20 0
      Unity/Assets/HotfixView/Demo/Unit/AfterUnitCreate_CreateUnitView.cs
  37. 11 0
      Unity/Assets/HotfixView/Demo/Unit/AfterUnitCreate_CreateUnitView.cs.meta
  38. 8 0
      Unity/Assets/HotfixView/Helper.meta
  39. 0 0
      Unity/Assets/HotfixView/Helper/ActionHelper.cs
  40. 2 3
      Unity/Assets/HotfixView/Helper/ActionHelper.cs.meta
  41. 0 0
      Unity/Assets/HotfixView/Helper/GameObjectHelper.cs
  42. 2 3
      Unity/Assets/HotfixView/Helper/GameObjectHelper.cs.meta
  43. 1 1
      Unity/Assets/HotfixView/Init.cs
  44. 0 0
      Unity/Assets/HotfixView/Init.cs.meta
  45. 8 0
      Unity/Assets/HotfixView/Module.meta
  46. 17 0
      Unity/Assets/HotfixView/Unity.HotfixView.asmdef
  47. 7 0
      Unity/Assets/HotfixView/Unity.HotfixView.asmdef.meta
  48. 1 0
      Unity/Assets/Model/Base/Event/EventIdType.cs
  49. 0 24
      Unity/Assets/Model/Demo/GlobalConfigComponent.cs
  50. 2 2
      Unity/Assets/Model/Demo/Helper/LoginHelper.cs
  51. 22 0
      Unity/Assets/Model/Demo/Helper/UnitFactory.cs
  52. 2 3
      Unity/Assets/Model/Demo/Helper/UnitFactory.cs.meta
  53. 6 6
      Unity/Assets/Model/Demo/M2C_PathfindingResultHandler.cs
  54. 0 3
      Unity/Assets/Model/Demo/UI/UILoading/Component.meta
  55. 0 50
      Unity/Assets/Model/Demo/UI/UILoading/Component/UILoadingComponent.cs
  56. 0 3
      Unity/Assets/Model/Demo/UI/UILoading/Component/UILoadingComponent.cs.meta
  57. 0 38
      Unity/Assets/Model/Demo/UI/UILobby/Component/UILobbyComponent.cs
  58. 0 36
      Unity/Assets/Model/Demo/UI/UILogin/Component/UILoginComponent.cs
  59. 0 8
      Unity/Assets/Model/Demo/UI/UILogin/System.meta
  60. 15 18
      Unity/Assets/Model/Demo/Unit.cs
  61. 0 27
      Unity/Assets/Model/Demo/UnitFactory.cs
  62. 3 3
      Unity/Assets/Model/Helper/BundleHelper.cs
  63. 5 5
      Unity/Assets/Model/Module/AssetsBundle/BundleDownloaderComponent.cs
  64. 0 14
      Unity/Assets/Model/Module/Config/ConfigHelper.cs
  65. 8 0
      Unity/Assets/ModelView.meta
  66. 8 0
      Unity/Assets/ModelView/Demo.meta
  67. 8 0
      Unity/Assets/ModelView/Demo/GlobalConfigComponent.cs
  68. 1 1
      Unity/Assets/ModelView/Demo/GlobalConfigComponent.cs.meta
  69. 8 0
      Unity/Assets/ModelView/Demo/UI.meta
  70. 0 0
      Unity/Assets/ModelView/Demo/UI/UILoading.meta
  71. 0 0
      Unity/Assets/ModelView/Demo/UI/UILoading/System.meta
  72. 10 0
      Unity/Assets/ModelView/Demo/UI/UILoading/UILoadingComponent.cs
  73. 11 0
      Unity/Assets/ModelView/Demo/UI/UILoading/UILoadingComponent.cs.meta
  74. 0 0
      Unity/Assets/ModelView/Demo/UI/UILobby.meta
  75. 12 0
      Unity/Assets/ModelView/Demo/UI/UILobby/UILobbyComponent.cs
  76. 1 1
      Unity/Assets/ModelView/Demo/UI/UILobby/UILobbyComponent.cs.meta
  77. 0 0
      Unity/Assets/ModelView/Demo/UI/UILogin.meta
  78. 14 0
      Unity/Assets/ModelView/Demo/UI/UILogin/UILoginComponent.cs
  79. 1 1
      Unity/Assets/ModelView/Demo/UI/UILogin/UILoginComponent.cs.meta
  80. 0 0
      Unity/Assets/ModelView/GizmosDebug.cs
  81. 0 0
      Unity/Assets/ModelView/GizmosDebug.cs.meta
  82. 8 0
      Unity/Assets/ModelView/Helper.meta
  83. 8 0
      Unity/Assets/ModelView/Module.meta
  84. 0 0
      Unity/Assets/ModelView/Module/UI.meta
  85. 0 0
      Unity/Assets/ModelView/Module/UI/CanvasConfig.cs
  86. 0 0
      Unity/Assets/ModelView/Module/UI/CanvasConfig.cs.meta
  87. 0 0
      Unity/Assets/ModelView/Module/UI/LayerNames.cs
  88. 0 0
      Unity/Assets/ModelView/Module/UI/LayerNames.cs.meta
  89. 1 1
      Unity/Assets/ModelView/Module/UI/UI.cs
  90. 0 0
      Unity/Assets/ModelView/Module/UI/UI.cs.meta
  91. 1 8
      Unity/Assets/ModelView/Module/UI/UIComponent.cs
  92. 0 0
      Unity/Assets/ModelView/Module/UI/UIComponent.cs.meta
  93. 0 0
      Unity/Assets/ModelView/Module/UI/UIFactoryAttribute.cs
  94. 0 0
      Unity/Assets/ModelView/Module/UI/UIFactoryAttribute.cs.meta
  95. 0 0
      Unity/Assets/ModelView/Module/UI/UIType.cs
  96. 0 0
      Unity/Assets/ModelView/Module/UI/UIType.cs.meta
  97. 0 0
      Unity/Assets/ModelView/Module/UI/UIViewComponent.cs
  98. 0 0
      Unity/Assets/ModelView/Module/UI/UIViewComponent.cs.meta
  99. 0 0
      Unity/Assets/ModelView/ReferenceCollector.cs
  100. 0 0
      Unity/Assets/ModelView/ReferenceCollector.cs.meta

+ 30 - 0
Client-Server.sln

@@ -39,6 +39,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoDB.Driver.Core", "Serv
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoDB.Driver.GridFS", "Server\ThirdParty\MongoDBDriver\MongoDB.Driver.GridFS\MongoDB.Driver.GridFS.csproj", "{2ACC29FB-55CD-4307-B1D1-CC3922BC2CE7}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.HotfixView", "Unity\Unity.HotfixView.csproj", "{D31345DE-9B88-525C-8E9C-744C99AE7509}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.ModelView", "Unity\Unity.ModelView.csproj", "{2F8409C1-DA01-D464-DBF2-00C6449E459E}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -205,6 +209,30 @@ Global
 		{2ACC29FB-55CD-4307-B1D1-CC3922BC2CE7}.Release|x64.Build.0 = Release|Any CPU
 		{2ACC29FB-55CD-4307-B1D1-CC3922BC2CE7}.Release|x86.ActiveCfg = Release|Any CPU
 		{2ACC29FB-55CD-4307-B1D1-CC3922BC2CE7}.Release|x86.Build.0 = Release|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Debug|x64.Build.0 = Debug|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Debug|x86.Build.0 = Debug|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Release|x64.ActiveCfg = Release|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Release|x64.Build.0 = Release|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Release|x86.ActiveCfg = Release|Any CPU
+		{D31345DE-9B88-525C-8E9C-744C99AE7509}.Release|x86.Build.0 = Release|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Debug|x64.Build.0 = Debug|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Debug|x86.Build.0 = Debug|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Release|x64.ActiveCfg = Release|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Release|x64.Build.0 = Release|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Release|x86.ActiveCfg = Release|Any CPU
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -225,6 +253,8 @@ Global
 		{B91E7D43-CCF1-49FC-ACF5-1C88A1C81FA7} = {14963D84-2A63-48CF-AE13-DCF71F1E13A0}
 		{AAF14EDB-BB72-42A9-80AA-3E0E113AC4CA} = {14963D84-2A63-48CF-AE13-DCF71F1E13A0}
 		{2ACC29FB-55CD-4307-B1D1-CC3922BC2CE7} = {14963D84-2A63-48CF-AE13-DCF71F1E13A0}
+		{D31345DE-9B88-525C-8E9C-744C99AE7509} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
+		{2F8409C1-DA01-D464-DBF2-00C6449E459E} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {EABC01E3-3EB5-47EF-B46E-AAD8BB3585F1}

+ 11 - 3
Unity/Assets/Editor/Unity.Editor.asmdef

@@ -2,12 +2,20 @@
     "name": "Unity.Editor",
     "references": [
         "Unity.Model",
-        "Unity.ThirdParty"
+        "Unity.ThirdParty",
+        "Unity.ModelView",
+        "Unity.Hotfix",
+        "Unity.HotfixView"
     ],
-    "optionalUnityReferences": [],
     "includePlatforms": [
         "Editor"
     ],
     "excludePlatforms": [],
-    "allowUnsafeCode": true
+    "allowUnsafeCode": true,
+    "overrideReferences": false,
+    "precompiledReferences": [],
+    "autoReferenced": true,
+    "defineConstraints": [],
+    "versionDefines": [],
+    "noEngineReferences": false
 }

+ 1 - 1
Unity/Assets/Model/Demo/UI/UILobby/System.meta → Unity/Assets/HotfixView.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 78c4c2aa6bd69e246aa101b0f91b64e2
+guid: 8a6619622b0455d41a4a5e994d763765
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 1 - 1
Unity/Assets/Model/Demo/UI/UILogin/Component.meta → Unity/Assets/HotfixView/Demo.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 3aa106b8bf611fa4c92dafd59511f371
+guid: f9fd1b2a1f4c85048b302c86bfbdcb16
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 15 - 0
Unity/Assets/HotfixView/Demo/GlobalConfigComponentSystem.cs

@@ -0,0 +1,15 @@
+using UnityEngine;
+
+namespace ET
+{
+    [ObjectSystem]
+    public class GlobalConfigComponentAwakeSystem : AwakeSystem<GlobalConfigComponent>
+    {
+        public override void Awake(GlobalConfigComponent self)
+        {
+            GameObject config = (GameObject)ResourcesHelper.Load("KV");
+            string configStr = config.Get<TextAsset>("GlobalProto").text;
+            self.GlobalProto = JsonHelper.FromJson<GlobalProto>(configStr);
+        }
+    }
+}

+ 11 - 0
Unity/Assets/HotfixView/Demo/GlobalConfigComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2a8a4a64cc1ce524291d3f31f91b736c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Unity/Assets/Model/Demo/UI.meta → Unity/Assets/HotfixView/Demo/UI.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 42620cb10d825cc419471229491963b9
+guid: ebb05994934e2ed46bf51d660a97ded9
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 1 - 1
Unity/Assets/Model/Demo/UI/UILobby/Component.meta → Unity/Assets/HotfixView/Demo/UI/UILoading.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: fee5cdfc2b9e8324ba07a30436354f8a
+guid: 2c47562c133e0f64cab579f4010e05dc
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILoading/System/LoadingBeginEvent_CreateLoadingUI.cs → Unity/Assets/HotfixView/Demo/UI/UILoading/LoadingBeginEvent_CreateLoadingUI.cs


+ 2 - 3
Unity/Assets/Model/Demo/UI/UILoading/System/LoadingBeginEvent_CreateLoadingUI.cs.meta → Unity/Assets/HotfixView/Demo/UI/UILoading/LoadingBeginEvent_CreateLoadingUI.cs.meta

@@ -1,8 +1,7 @@
 fileFormatVersion: 2
-guid: c6fbdc0db35bbfb4cbf22e7c85e211d1
-timeCreated: 1510748796
-licenseType: Free
+guid: d36937003d983464ea92fa49808ae48a
 MonoImporter:
+  externalObjects: {}
   serializedVersion: 2
   defaultReferences: []
   executionOrder: 0

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILoading/System/LoadingFinishEvent_RemoveLoadingUI.cs → Unity/Assets/HotfixView/Demo/UI/UILoading/LoadingFinishEvent_RemoveLoadingUI.cs


+ 2 - 3
Unity/Assets/Model/Demo/UI/UILoading/System/LoadingFinishEvent_RemoveLoadingUI.cs.meta → Unity/Assets/HotfixView/Demo/UI/UILoading/LoadingFinishEvent_RemoveLoadingUI.cs.meta

@@ -1,8 +1,7 @@
 fileFormatVersion: 2
-guid: df6c6e79866b6c344913ff481bf8b81d
-timeCreated: 1510748796
-licenseType: Free
+guid: 3e411f50d32da754d8064d3dffaf49eb
 MonoImporter:
+  externalObjects: {}
   serializedVersion: 2
   defaultReferences: []
   executionOrder: 0

+ 46 - 0
Unity/Assets/HotfixView/Demo/UI/UILoading/UILoadingComponentSystem.cs

@@ -0,0 +1,46 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace ET
+{
+    [ObjectSystem]
+    public class UiLoadingComponentAwakeSystem : AwakeSystem<UILoadingComponent>
+    {
+        public override void Awake(UILoadingComponent self)
+        {
+            self.text = self.GetParent<UI>().GameObject.Get<GameObject>("Text").GetComponent<Text>();
+        }
+    }
+
+    [ObjectSystem]
+    public class UiLoadingComponentStartSystem : StartSystem<UILoadingComponent>
+    {
+        public override void Start(UILoadingComponent self)
+        {
+            StartAsync(self).Coroutine();
+        }
+		
+        public async ETVoid StartAsync(UILoadingComponent self)
+        {
+            TimerComponent timerComponent = Game.Scene.GetComponent<TimerComponent>();
+            long instanceId = self.InstanceId;
+            while (true)
+            {
+                await timerComponent.WaitAsync(1000);
+
+                if (self.InstanceId != instanceId)
+                {
+                    return;
+                }
+
+                BundleDownloaderComponent bundleDownloaderComponent = Game.Scene.GetComponent<BundleDownloaderComponent>();
+                if (bundleDownloaderComponent == null)
+                {
+                    continue;
+                }
+                self.text.text = $"{bundleDownloaderComponent.Progress}%";
+            }
+        }
+    }
+
+}

+ 11 - 0
Unity/Assets/HotfixView/Demo/UI/UILoading/UILoadingComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b0d23a49d8c00f346b6ffc0a39d509ea
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILoading/System/UILoadingFactory.cs → Unity/Assets/HotfixView/Demo/UI/UILoading/UILoadingFactory.cs


+ 1 - 1
Unity/Assets/Model/Demo/UI/UILoading/System/UILoadingFactory.cs.meta → Unity/Assets/HotfixView/Demo/UI/UILoading/UILoadingFactory.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: e594570a81205e64498b20098b1134cb
+guid: e33bf5d983ac4984eb672c26e92f5b3b
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 8 - 0
Unity/Assets/HotfixView/Demo/UI/UILobby.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6999a8b10a4a54c4fba4f234c0155509
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILobby/System/EnterMapFinish_RemoveLobbyUI.cs → Unity/Assets/HotfixView/Demo/UI/UILobby/EnterMapFinish_RemoveLobbyUI.cs


+ 1 - 1
Unity/Assets/Model/Demo/UI/UILobby/System/EnterMapFinish_RemoveLobbyUI.cs.meta → Unity/Assets/HotfixView/Demo/UI/UILobby/EnterMapFinish_RemoveLobbyUI.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 5da32d70909c6af45b1d7ce6b3ac95a8
+guid: 9f2a195ef22592645aaa4a4964153c15
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILobby/System/LoginFinish_CreateLobbyUI.cs → Unity/Assets/HotfixView/Demo/UI/UILobby/LoginFinish_CreateLobbyUI.cs


+ 1 - 1
Unity/Assets/Model/Demo/UI/UILobby/System/LoginFinish_CreateLobbyUI.cs.meta → Unity/Assets/HotfixView/Demo/UI/UILobby/LoginFinish_CreateLobbyUI.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 04c3d7f7581299d4f881337c586d1bb7
+guid: b987fdc9ae42d8d4992d429058fb72b2
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 26 - 0
Unity/Assets/HotfixView/Demo/UI/UILobby/UILobbyComponentSystem.cs

@@ -0,0 +1,26 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace ET
+{
+    [ObjectSystem]
+    public class UILobbyComponentAwakeSystem : AwakeSystem<UILobbyComponent>
+    {
+        public override void Awake(UILobbyComponent self)
+        {
+            ReferenceCollector rc = self.GetParent<UI>().ViewGO.GetComponent<ReferenceCollector>();
+			
+            self.enterMap = rc.Get<GameObject>("EnterMap");
+            self.enterMap.GetComponent<Button>().onClick.Add(self.EnterMap);
+            self.text = rc.Get<GameObject>("Text").GetComponent<Text>();
+        }
+    }
+    
+    public static class UILobbyComponentSystem
+    {
+        public static void EnterMap(this UILobbyComponent self)
+        {
+            MapHelper.EnterMapAsync("Map").Coroutine();
+        }
+    }
+}

+ 11 - 0
Unity/Assets/HotfixView/Demo/UI/UILobby/UILobbyComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e9b28993960655f428050b7fa333a149
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILobby/System/UILobbyFactory.cs → Unity/Assets/HotfixView/Demo/UI/UILobby/UILobbyFactory.cs


+ 1 - 1
Unity/Assets/Model/Demo/UI/UILobby/System/UILobbyFactory.cs.meta → Unity/Assets/HotfixView/Demo/UI/UILobby/UILobbyFactory.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 44e2c1e8fc8b50f4e993270e0f5644ff
+guid: 67ca4e4ba3fc2414289ea08371fd8f6e
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 8 - 0
Unity/Assets/HotfixView/Demo/UI/UILogin.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 71384e3849489314ea46362ce8f5dff8
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILogin/System/InitSceneStart_CreateLoginUI.cs → Unity/Assets/HotfixView/Demo/UI/UILogin/InitSceneStart_CreateLoginUI.cs


+ 1 - 1
Unity/Assets/Model/Demo/UI/UILogin/System/InitSceneStart_CreateLoginUI.cs.meta → Unity/Assets/HotfixView/Demo/UI/UILogin/InitSceneStart_CreateLoginUI.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 84bcd66cf30541c49ac1e8fa5acb8bff
+guid: 157b06c3e92d4ae47a49ad0e76fa88a2
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILogin/System/LoginFinish_RemoveLoginUI.cs → Unity/Assets/HotfixView/Demo/UI/UILogin/LoginFinish_RemoveLoginUI.cs


+ 1 - 1
Unity/Assets/Model/Demo/UI/UILogin/System/LoginFinish_RemoveLoginUI.cs.meta → Unity/Assets/HotfixView/Demo/UI/UILogin/LoginFinish_RemoveLoginUI.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: c6bb7d4c0249dc14e9a1021ce82fabe3
+guid: 488b91e3bda785846ab71b43a873cd05
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 28 - 0
Unity/Assets/HotfixView/Demo/UI/UILogin/UILoginComponentSystem.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Net;
+
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace ET
+{
+	[ObjectSystem]
+	public class UILoginComponentAwakeSystem : AwakeSystem<UILoginComponent>
+	{
+		public override void Awake(UILoginComponent self)
+		{
+			ReferenceCollector rc = self.GetParent<UI>().ViewGO.GetComponent<ReferenceCollector>();
+			self.loginBtn = rc.Get<GameObject>("LoginBtn");
+			self.loginBtn.GetComponent<Button>().onClick.Add(self.OnLogin);
+			self.account = rc.Get<GameObject>("Account");
+		}
+	}
+	
+	public static class UILoginComponentSystem
+	{
+		public static void OnLogin(this UILoginComponent self)
+		{
+			LoginHelper.OnLoginAsync(self.Domain, "127.0.0.1:10002", self.account.GetComponent<InputField>().text).Coroutine();
+		}
+	}
+}

+ 11 - 0
Unity/Assets/HotfixView/Demo/UI/UILogin/UILoginComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 784972e6ed6f60c48929f26f6ff3ab88
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILogin/System/UILoginFactory.cs → Unity/Assets/HotfixView/Demo/UI/UILogin/UILoginFactory.cs


+ 1 - 1
Unity/Assets/Model/Demo/UI/UILogin/System/UILoginFactory.cs.meta → Unity/Assets/HotfixView/Demo/UI/UILogin/UILoginFactory.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 889f2e5fbc3a4134ea1c11ff65236f75
+guid: 746fb2e27ae09fd4d836da59f0dc92cc
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 8 - 0
Unity/Assets/HotfixView/Demo/Unit.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 68f9595937336f9478ea82d7f82a263f
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 0
Unity/Assets/HotfixView/Demo/Unit/AfterUnitCreate_CreateUnitView.cs

@@ -0,0 +1,20 @@
+using UnityEngine;
+
+namespace ET
+{
+    [Event(EventIdType.AfterUnitCreate)]
+    public class AfterUnitCreate_CreateUnitView: AEvent<Unit>
+    {
+        public override void Run(Unit unit)
+        {
+            // Unit View层
+            ResourcesComponent resourcesComponent = Game.Scene.GetComponent<ResourcesComponent>();
+            GameObject bundleGameObject = (GameObject)resourcesComponent.GetAsset("Unit.unity3d", "Unit");
+            GameObject prefab = bundleGameObject.Get<GameObject>("Skeleton");
+	        
+            GameObject go = UnityEngine.Object.Instantiate(prefab);
+            
+            unit.AddComponent<AnimatorComponent>();
+        }
+    }
+}

+ 11 - 0
Unity/Assets/HotfixView/Demo/Unit/AfterUnitCreate_CreateUnitView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: deed42c610a23384085aaf344998875d
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Assets/HotfixView/Helper.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 39d1e129a66bc854199a728475d43224
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Model/Helper/ActionHelper.cs → Unity/Assets/HotfixView/Helper/ActionHelper.cs


+ 2 - 3
Unity/Assets/Model/Helper/ActionHelper.cs.meta → Unity/Assets/HotfixView/Helper/ActionHelper.cs.meta

@@ -1,8 +1,7 @@
 fileFormatVersion: 2
-guid: 3ae0366e51013cd4ca6209786d7aaac4
-timeCreated: 1487390785
-licenseType: Pro
+guid: 561346b5a792e9843941da7bc901f2e6
 MonoImporter:
+  externalObjects: {}
   serializedVersion: 2
   defaultReferences: []
   executionOrder: 0

+ 0 - 0
Unity/Assets/Model/Helper/GameObjectHelper.cs → Unity/Assets/HotfixView/Helper/GameObjectHelper.cs


+ 2 - 3
Unity/Assets/Model/Helper/GameObjectHelper.cs.meta → Unity/Assets/HotfixView/Helper/GameObjectHelper.cs.meta

@@ -1,8 +1,7 @@
 fileFormatVersion: 2
-guid: aae5801bb8dddb648b2347dc09067765
-timeCreated: 1498118314
-licenseType: Free
+guid: 72f321a8d1e56ee47ae4e3d5eb010161
 MonoImporter:
+  externalObjects: {}
   serializedVersion: 2
   defaultReferences: []
   executionOrder: 0

+ 1 - 1
Unity/Assets/Model/Init.cs → Unity/Assets/HotfixView/Init.cs

@@ -29,7 +29,7 @@ namespace ET
 				Game.Scene.AddComponent<UIComponent>();
 
 				// 下载ab包
-				await BundleHelper.DownloadBundle();
+				//await BundleHelper.DownloadBundle("1111");
 
 				// 加载配置
 				Game.Scene.GetComponent<ResourcesComponent>().LoadBundle("config.unity3d");

+ 0 - 0
Unity/Assets/Model/Init.cs.meta → Unity/Assets/HotfixView/Init.cs.meta


+ 8 - 0
Unity/Assets/HotfixView/Module.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0850edb2f02b2d34091700c557b963ac
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 17 - 0
Unity/Assets/HotfixView/Unity.HotfixView.asmdef

@@ -0,0 +1,17 @@
+{
+    "name": "Unity.HotfixView",
+    "references": [
+        "GUID:703e1d0810996ed4b9064f1041de8bdc",
+        "GUID:997f003cfffd9ec4fae70c0ac9b0ec2b",
+        "GUID:f7aec9df9b7212e448c697d7ebf558a3"
+    ],
+    "includePlatforms": [],
+    "excludePlatforms": [],
+    "allowUnsafeCode": false,
+    "overrideReferences": false,
+    "precompiledReferences": [],
+    "autoReferenced": true,
+    "defineConstraints": [],
+    "versionDefines": [],
+    "noEngineReferences": false
+}

+ 7 - 0
Unity/Assets/HotfixView/Unity.HotfixView.asmdef.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 9296492e57c1dab41b26cf0e69d84828
+AssemblyDefinitionImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 0
Unity/Assets/Model/Base/Event/EventIdType.cs

@@ -25,5 +25,6 @@
 		public const string InitSceneStart = "InitSceneStart";
 		public const string LoginFinish = "LoginFinish";
 		public const string EnterMapFinish = "EnterMapFinish";
+		public const string AfterUnitCreate = "AfterUnitCreate";
 	}
 }

+ 0 - 24
Unity/Assets/Model/Demo/GlobalConfigComponent.cs

@@ -1,24 +0,0 @@
-namespace ET
-{
-	[ObjectSystem]
-	public class GlobalConfigComponentAwakeSystem : AwakeSystem<GlobalConfigComponent>
-	{
-		public override void Awake(GlobalConfigComponent t)
-		{
-			t.Awake();
-		}
-	}
-
-	public class GlobalConfigComponent : Entity
-	{
-		public static GlobalConfigComponent Instance;
-		public GlobalProto GlobalProto;
-
-		public void Awake()
-		{
-			Instance = this;
-			string configStr = ConfigHelper.GetGlobal();
-			this.GlobalProto = JsonHelper.FromJson<GlobalProto>(configStr);
-		}
-	}
-}

+ 2 - 2
Unity/Assets/Model/Demo/Helper/LoginHelper.cs

@@ -5,12 +5,12 @@ namespace ET
 {
     public static class LoginHelper
     {
-        public static async ETVoid OnLoginAsync(Entity domain, string account)
+        public static async ETVoid OnLoginAsync(Entity domain, string address, string account)
         {
             try
             {
                 // 创建一个ETModel层的Session
-                Session session = Game.Scene.GetComponent<NetOuterComponent>().Create(GlobalConfigComponent.Instance.GlobalProto.Address);
+                Session session = Game.Scene.GetComponent<NetOuterComponent>().Create(address);
 				
                 // 创建一个ETHotfix层的Session, ETHotfix的Session会通过ETModel层的Session发送消息
                 Session realmSession = EntityFactory.Create<Session, Session>(domain, session);

+ 22 - 0
Unity/Assets/Model/Demo/Helper/UnitFactory.cs

@@ -0,0 +1,22 @@
+using UnityEngine;
+
+namespace ET
+{
+    public static class UnitFactory
+    {
+        public static Unit Create(Entity domain, long id)
+        {
+	        Unit unit = EntityFactory.CreateWithId<Unit>(domain, id);
+	        
+			unit.AddComponent<MoveComponent>();
+	        unit.AddComponent<TurnComponent>();
+	        unit.AddComponent<UnitPathComponent>();
+
+	        Game.EventSystem.Run(EventIdType.AfterUnitCreate, unit);
+	        
+	        UnitComponent unitComponent = Game.Scene.GetComponent<UnitComponent>();
+            unitComponent.Add(unit);
+            return unit;
+        }
+    }
+}

+ 2 - 3
Unity/Assets/Model/Demo/UnitFactory.cs.meta → Unity/Assets/Model/Demo/Helper/UnitFactory.cs.meta

@@ -1,8 +1,7 @@
 fileFormatVersion: 2
-guid: 965781ba4eac37145b94739c86134b6f
-timeCreated: 1506146596
-licenseType: Free
+guid: 45b50dcae5e97fd42817d86586643af9
 MonoImporter:
+  externalObjects: {}
   serializedVersion: 2
   defaultReferences: []
   executionOrder: 0

+ 6 - 6
Unity/Assets/Model/Demo/M2C_PathfindingResultHandler.cs

@@ -16,12 +16,12 @@ namespace ET
 
 			unitPathComponent.StartMove(message).Coroutine();
 
-			GizmosDebug.Instance.Path.Clear();
-			GizmosDebug.Instance.Path.Add(new Vector3(message.X, message.Y, message.Z));
-			for (int i = 0; i < message.Xs.Count; ++i)
-			{
-				GizmosDebug.Instance.Path.Add(new Vector3(message.Xs[i], message.Ys[i], message.Zs[i]));
-			}
+			//GizmosDebug.Instance.Path.Clear();
+			//GizmosDebug.Instance.Path.Add(new Vector3(message.X, message.Y, message.Z));
+			//for (int i = 0; i < message.Xs.Count; ++i)
+			//{
+			//	GizmosDebug.Instance.Path.Add(new Vector3(message.Xs[i], message.Ys[i], message.Zs[i]));
+			//}
 
 			await ETTask.CompletedTask;
 		}

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

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

+ 0 - 50
Unity/Assets/Model/Demo/UI/UILoading/Component/UILoadingComponent.cs

@@ -1,50 +0,0 @@
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace ET
-{
-	[ObjectSystem]
-	public class UiLoadingComponentAwakeSystem : AwakeSystem<UILoadingComponent>
-	{
-		public override void Awake(UILoadingComponent self)
-		{
-			self.text = self.GetParent<UI>().ViewGO.Get<GameObject>("Text").GetComponent<Text>();
-		}
-	}
-
-	[ObjectSystem]
-	public class UiLoadingComponentStartSystem : StartSystem<UILoadingComponent>
-	{
-		public override void Start(UILoadingComponent self)
-		{
-			StartAsync(self).Coroutine();
-		}
-		
-		public async ETVoid StartAsync(UILoadingComponent self)
-		{
-			TimerComponent timerComponent = Game.Scene.GetComponent<TimerComponent>();
-			long instanceId = self.InstanceId;
-			while (true)
-			{
-				await timerComponent.WaitAsync(1000);
-
-				if (self.InstanceId != instanceId)
-				{
-					return;
-				}
-
-				BundleDownloaderComponent bundleDownloaderComponent = Game.Scene.GetComponent<BundleDownloaderComponent>();
-				if (bundleDownloaderComponent == null)
-				{
-					continue;
-				}
-				self.text.text = $"{bundleDownloaderComponent.Progress}%";
-			}
-		}
-	}
-
-	public class UILoadingComponent : Entity
-	{
-		public Text text;
-	}
-}

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

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

+ 0 - 38
Unity/Assets/Model/Demo/UI/UILobby/Component/UILobbyComponent.cs

@@ -1,38 +0,0 @@
-
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace ET
-{
-	[ObjectSystem]
-	public class UiLobbyComponentSystem : AwakeSystem<UILobbyComponent>
-	{
-		public override void Awake(UILobbyComponent self)
-		{
-			self.Awake();
-		}
-	}
-	
-	public class UILobbyComponent : Entity
-	{
-		private GameObject enterMap;
-		private Text text;
-
-		public void Awake()
-		{
-			ReferenceCollector rc = this.GetParent<UI>().ViewGO.GetComponent<ReferenceCollector>();
-			
-			enterMap = rc.Get<GameObject>("EnterMap");
-			enterMap.GetComponent<Button>().onClick.Add(this.EnterMap);
-
-			this.text = rc.Get<GameObject>("Text").GetComponent<Text>();
-		}
-
-		private void EnterMap()
-		{
-			MapHelper.EnterMapAsync("Map").Coroutine();
-		}
-		
-
-	}
-}

+ 0 - 36
Unity/Assets/Model/Demo/UI/UILogin/Component/UILoginComponent.cs

@@ -1,36 +0,0 @@
-using System;
-using System.Net;
-
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace ET
-{
-	[ObjectSystem]
-	public class UiLoginComponentSystem : AwakeSystem<UILoginComponent>
-	{
-		public override void Awake(UILoginComponent self)
-		{
-			self.Awake();
-		}
-	}
-	
-	public class UILoginComponent: Entity
-	{
-		private GameObject account;
-		private GameObject loginBtn;
-
-		public void Awake()
-		{
-			ReferenceCollector rc = this.GetParent<UI>().ViewGO.GetComponent<ReferenceCollector>();
-			loginBtn = rc.Get<GameObject>("LoginBtn");
-			loginBtn.GetComponent<Button>().onClick.Add(OnLogin);
-			this.account = rc.Get<GameObject>("Account");
-		}
-
-		public void OnLogin()
-		{
-			LoginHelper.OnLoginAsync(this.Domain, this.account.GetComponent<InputField>().text).Coroutine();
-		}
-	}
-}

+ 0 - 8
Unity/Assets/Model/Demo/UI/UILogin/System.meta

@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: c25058f9c25232f4ab306a7ae9ebc50a
-folderAsset: yes
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 15 - 18
Unity/Assets/Model/Demo/Unit.cs

@@ -5,46 +5,43 @@ using Vector3 = UnityEngine.Vector3;
 
 namespace ET
 {
-	[ObjectSystem]
-	public class UnitAwakeSystem : AwakeSystem<Unit, GameObject>
-	{
-		public override void Awake(Unit self, GameObject gameObject)
-		{
-			self.Awake(gameObject);
-		}
-	}
-	
-	[HideInHierarchy]
 	public sealed class Unit: Entity
 	{
-		public GameObject GameObject;
-		
-		public void Awake(GameObject gameObject)
+		public int ConfigId;
+
+		public UnitConfig Config
 		{
-			this.GameObject = gameObject;
+			get
+			{
+				return UnitConfigCategory.Instance.Get(this.ConfigId);
+			}
 		}
 		
+		private Vector3 position;
+		
 		public Vector3 Position
 		{
 			get
 			{
-				return GameObject.transform.position;
+				return position;
 			}
 			set
 			{
-				GameObject.transform.position = value;
+				this.position = value;
 			}
 		}
 
+		private Quaternion rotation;
+
 		public Quaternion Rotation
 		{
 			get
 			{
-				return GameObject.transform.rotation;
+				return rotation;
 			}
 			set
 			{
-				GameObject.transform.rotation = value;
+				this.rotation = value;
 			}
 		}
 	}

+ 0 - 27
Unity/Assets/Model/Demo/UnitFactory.cs

@@ -1,27 +0,0 @@
-using UnityEngine;
-
-namespace ET
-{
-    public static class UnitFactory
-    {
-        public static Unit Create(Entity domain, long id)
-        {
-	        ResourcesComponent resourcesComponent = Game.Scene.GetComponent<ResourcesComponent>();
-	        GameObject bundleGameObject = (GameObject)resourcesComponent.GetAsset("Unit.unity3d", "Unit");
-	        GameObject prefab = bundleGameObject.Get<GameObject>("Skeleton");
-	        
-            UnitComponent unitComponent = Game.Scene.GetComponent<UnitComponent>();
-            
-	        GameObject go = UnityEngine.Object.Instantiate(prefab);
-	        Unit unit = EntityFactory.CreateWithId<Unit, GameObject>(domain, id, go);
-	        
-			unit.AddComponent<AnimatorComponent>();
-	        unit.AddComponent<MoveComponent>();
-	        unit.AddComponent<TurnComponent>();
-	        unit.AddComponent<UnitPathComponent>();
-
-            unitComponent.Add(unit);
-            return unit;
-        }
-    }
-}

+ 3 - 3
Unity/Assets/Model/Helper/BundleHelper.cs

@@ -7,7 +7,7 @@ namespace ET
 {
 	public static class BundleHelper
 	{
-		public static async ETTask DownloadBundle()
+		public static async ETTask DownloadBundle(string url)
 		{
 			if (Define.IsAsync)
 			{
@@ -15,11 +15,11 @@ namespace ET
 				{
 					using (BundleDownloaderComponent bundleDownloaderComponent = Game.Scene.AddComponent<BundleDownloaderComponent>())
 					{
-						await bundleDownloaderComponent.StartAsync();
+						await bundleDownloaderComponent.StartAsync(url);
 						
 						Game.EventSystem.Run(EventIdType.LoadingBegin);
 						
-						await bundleDownloaderComponent.DownloadAsync();
+						await bundleDownloaderComponent.DownloadAsync(url);
 					}
 					
 					Game.EventSystem.Run(EventIdType.LoadingFinish);

+ 5 - 5
Unity/Assets/Model/Module/AssetsBundle/BundleDownloaderComponent.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 namespace ET
 {
 	[ObjectSystem]
-	public class UiBundleDownloaderComponentAwakeSystem : AwakeSystem<BundleDownloaderComponent>
+	public class BundleDownloaderComponentAwakeSystem : AwakeSystem<BundleDownloaderComponent>
 	{
 		public override void Awake(BundleDownloaderComponent self)
 		{
@@ -57,7 +57,7 @@ namespace ET
 				this.Parent.RemoveComponent<BundleDownloaderComponent>();
 		}
 
-		public async ETTask StartAsync()
+		public async ETTask StartAsync(string url)
 		{
 			// 获取远程的Version.txt
 			string versionUrl = "";
@@ -65,7 +65,7 @@ namespace ET
 			{
 				using (UnityWebRequestAsync webRequestAsync = EntityFactory.Create<UnityWebRequestAsync>(this.Domain))
 				{
-					versionUrl = GlobalConfigComponent.Instance.GlobalProto.GetUrl() + "StreamingAssets/" + "Version.txt";
+					versionUrl = url + "StreamingAssets/" + "Version.txt";
 					//Log.Debug(versionUrl);
 					await webRequestAsync.DownloadAsync(versionUrl);
 					remoteVersionConfig = JsonHelper.FromJson<VersionConfig>(webRequestAsync.Request.downloadHandler.text);
@@ -149,7 +149,7 @@ namespace ET
 			}
 		}
 
-		public async ETTask DownloadAsync()
+		public async ETTask DownloadAsync(string url)
 		{
 			if (this.bundles.Count == 0 && this.downloadingBundle == "")
 			{
@@ -173,7 +173,7 @@ namespace ET
 						{
 							using (this.webRequest = EntityFactory.Create<UnityWebRequestAsync>(this.Domain))
 							{
-								await this.webRequest.DownloadAsync(GlobalConfigComponent.Instance.GlobalProto.GetUrl() + "StreamingAssets/" + this.downloadingBundle);
+								await this.webRequest.DownloadAsync(url + "StreamingAssets/" + this.downloadingBundle);
 								byte[] data = this.webRequest.Request.downloadHandler.data;
 
 								string path = Path.Combine(PathHelper.AppHotfixResPath, this.downloadingBundle);

+ 0 - 14
Unity/Assets/Model/Module/Config/ConfigHelper.cs

@@ -17,20 +17,6 @@ namespace ET
 				throw new Exception($"load config file fail, key: {key}", e);
 			}
 		}
-		
-		public static string GetGlobal()
-		{
-			try
-			{
-				GameObject config = (GameObject)ResourcesHelper.Load("KV");
-				string configStr = config.Get<TextAsset>("GlobalProto").text;
-				return configStr;
-			}
-			catch (Exception e)
-			{
-				throw new Exception($"load global config file fail", e);
-			}
-		}
 
 		public static T ToObject<T>(string str)
 		{

+ 8 - 0
Unity/Assets/ModelView.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 161edd7143aba6443893d37bb47b5839
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Assets/ModelView/Demo.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7261a9418b21a9f4c90e7b5528372911
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Assets/ModelView/Demo/GlobalConfigComponent.cs

@@ -0,0 +1,8 @@
+namespace ET
+{
+	public class GlobalConfigComponent : Entity
+	{
+		public static GlobalConfigComponent Instance;
+		public GlobalProto GlobalProto;
+	}
+}

+ 1 - 1
Unity/Assets/Model/Demo/GlobalConfigComponent.cs.meta → Unity/Assets/ModelView/Demo/GlobalConfigComponent.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 989e45d189229d74d83f376ada23eaeb
+guid: 1ec19fad8f71efc45a7e85dd95b0cf29
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 8 - 0
Unity/Assets/ModelView/Demo/UI.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5875a1089fd5c0446869586dddd4b1eb
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILoading.meta → Unity/Assets/ModelView/Demo/UI/UILoading.meta


+ 0 - 0
Unity/Assets/Model/Demo/UI/UILoading/System.meta → Unity/Assets/ModelView/Demo/UI/UILoading/System.meta


+ 10 - 0
Unity/Assets/ModelView/Demo/UI/UILoading/UILoadingComponent.cs

@@ -0,0 +1,10 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace ET
+{
+	public class UILoadingComponent : Entity
+	{
+		public Text text;
+	}
+}

+ 11 - 0
Unity/Assets/ModelView/Demo/UI/UILoading/UILoadingComponent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 37d055e48129d734db2c7b2e1c22e41c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILobby.meta → Unity/Assets/ModelView/Demo/UI/UILobby.meta


+ 12 - 0
Unity/Assets/ModelView/Demo/UI/UILobby/UILobbyComponent.cs

@@ -0,0 +1,12 @@
+
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace ET
+{
+	public class UILobbyComponent : Entity
+	{
+		public GameObject enterMap;
+		public Text text;
+	}
+}

+ 1 - 1
Unity/Assets/Model/Demo/UI/UILobby/Component/UILobbyComponent.cs.meta → Unity/Assets/ModelView/Demo/UI/UILobby/UILobbyComponent.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 9cabd79d330928840928c328f5218fa0
+guid: 395dc5969ccdf2b4caf6b063bbb4592b
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 0 - 0
Unity/Assets/Model/Demo/UI/UILogin.meta → Unity/Assets/ModelView/Demo/UI/UILogin.meta


+ 14 - 0
Unity/Assets/ModelView/Demo/UI/UILogin/UILoginComponent.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Net;
+
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace ET
+{
+	public class UILoginComponent: Entity
+	{
+		public GameObject account;
+		public GameObject loginBtn;
+	}
+}

+ 1 - 1
Unity/Assets/Model/Demo/UI/UILogin/Component/UILoginComponent.cs.meta → Unity/Assets/ModelView/Demo/UI/UILogin/UILoginComponent.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 5b9ad0d71a8dfd748bc4a9bae1a5b38b
+guid: 7c4b7d6a8e39e174296c61cac3ff39d8
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 0 - 0
Unity/Assets/Model/Other/GizmosDebug.cs → Unity/Assets/ModelView/GizmosDebug.cs


+ 0 - 0
Unity/Assets/Model/Other/GizmosDebug.cs.meta → Unity/Assets/ModelView/GizmosDebug.cs.meta


+ 8 - 0
Unity/Assets/ModelView/Helper.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 543bdb6ba0696034083ca26876560c56
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Assets/ModelView/Module.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3df0a834926ebb3499a23299b139c7e4
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Model/Module/UI.meta → Unity/Assets/ModelView/Module/UI.meta


+ 0 - 0
Unity/Assets/Model/Module/UI/CanvasConfig.cs → Unity/Assets/ModelView/Module/UI/CanvasConfig.cs


+ 0 - 0
Unity/Assets/Model/Module/UI/CanvasConfig.cs.meta → Unity/Assets/ModelView/Module/UI/CanvasConfig.cs.meta


+ 0 - 0
Unity/Assets/Model/Module/UI/LayerNames.cs → Unity/Assets/ModelView/Module/UI/LayerNames.cs


+ 0 - 0
Unity/Assets/Model/Module/UI/LayerNames.cs.meta → Unity/Assets/ModelView/Module/UI/LayerNames.cs.meta


+ 1 - 1
Unity/Assets/Model/Module/UI/UI.cs → Unity/Assets/ModelView/Module/UI/UI.cs

@@ -5,7 +5,7 @@ using UnityEngine;
 namespace ET
 {
 	[ObjectSystem]
-	public class UiAwakeSystem : AwakeSystem<UI, string, GameObject>
+	public class UIAwakeSystem : AwakeSystem<UI, string, GameObject>
 	{
 		public override void Awake(UI self, string name, GameObject gameObject)
 		{

+ 0 - 0
Unity/Assets/Model/Module/UI/UI.cs.meta → Unity/Assets/ModelView/Module/UI/UI.cs.meta


+ 1 - 8
Unity/Assets/Model/Module/UI/UIComponent.cs → Unity/Assets/ModelView/Module/UI/UIComponent.cs

@@ -1,6 +1,4 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
+using System.Collections.Generic;
 
 namespace ET
 {
@@ -9,7 +7,6 @@ namespace ET
 	{
 		public override void Awake(UIComponent self)
 		{
-			self.Camera = Entity.Global.transform.Find("UICamera").gameObject;
 		}
 	}
 	
@@ -18,14 +15,10 @@ namespace ET
 	/// </summary>
 	public class UIComponent: Entity
 	{
-		public GameObject Camera;
-		
 		public Dictionary<string, UI> uis = new Dictionary<string, UI>();
 
 		public void Add(UI ui)
 		{
-			ui.ViewGO.GetComponent<Canvas>().worldCamera = this.Camera.GetComponent<Camera>();
-			
 			this.uis.Add(ui.Name, ui);
 			ui.Parent = this;
 		}

+ 0 - 0
Unity/Assets/Model/Module/UI/UIComponent.cs.meta → Unity/Assets/ModelView/Module/UI/UIComponent.cs.meta


+ 0 - 0
Unity/Assets/Model/Module/UI/UIFactoryAttribute.cs → Unity/Assets/ModelView/Module/UI/UIFactoryAttribute.cs


+ 0 - 0
Unity/Assets/Model/Module/UI/UIFactoryAttribute.cs.meta → Unity/Assets/ModelView/Module/UI/UIFactoryAttribute.cs.meta


+ 0 - 0
Unity/Assets/Model/Module/UI/UIType.cs → Unity/Assets/ModelView/Module/UI/UIType.cs


+ 0 - 0
Unity/Assets/Model/Module/UI/UIType.cs.meta → Unity/Assets/ModelView/Module/UI/UIType.cs.meta


+ 0 - 0
Unity/Assets/Model/Module/UI/UIViewComponent.cs → Unity/Assets/ModelView/Module/UI/UIViewComponent.cs


+ 0 - 0
Unity/Assets/Model/Module/UI/UIViewComponent.cs.meta → Unity/Assets/ModelView/Module/UI/UIViewComponent.cs.meta


+ 0 - 0
Unity/Assets/Model/Other/ReferenceCollector.cs → Unity/Assets/ModelView/ReferenceCollector.cs


+ 0 - 0
Unity/Assets/Model/Other/ReferenceCollector.cs.meta → Unity/Assets/ModelView/ReferenceCollector.cs.meta


Some files were not shown because too many files changed in this diff