Browse Source

初始化ET

guodong 3 years ago
parent
commit
f78d911b5c
89 changed files with 153 additions and 2198 deletions
  1. 4 16
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/AppStart_Init.cs
  2. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo.meta
  3. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config.meta
  4. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config/ConfigComponent_SetConfigLoader_Awake.cs
  5. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config/ConfigComponent_SetConfigLoader_Awake.cs.meta
  6. 0 26
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config/ConfigLoader.cs
  7. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config/ConfigLoader.cs.meta
  8. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Global.meta
  9. 0 17
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Global/GlobalComponentSystem.cs
  10. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Opera.meta
  11. 0 57
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Opera/OperaComponentSystem.cs
  12. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene.meta
  13. 0 13
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/AfterCreateCurrentScene_AddComponent.cs
  14. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/AfterCreateCurrentScene_AddComponent.cs.meta
  15. 0 14
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/AfterCreateZoneScene_AddComponent.cs
  16. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/AfterCreateZoneScene_AddComponent.cs.meta
  17. 0 55
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/SceneChangeComponentSystem.cs
  18. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/SceneChangeComponentSystem.cs.meta
  19. 0 30
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/SceneChangeStart_AddComponent.cs
  20. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/SceneChangeStart_AddComponent.cs.meta
  21. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI.meta
  22. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp.meta
  23. 0 10
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp/SceneChangeFinishEvent_CreateUIHelp.cs
  24. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp/SceneChangeFinishEvent_CreateUIHelp.cs.meta
  25. 0 32
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp/UIHelpEvent.cs
  26. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp/UIHelpEvent.cs.meta
  27. 0 16
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelper.cs
  28. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelper.cs.meta
  29. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading.meta
  30. 0 12
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/LoadingBeginEvent_CreateLoadingUI.cs
  31. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/LoadingBeginEvent_CreateLoadingUI.cs.meta
  32. 0 10
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/LoadingFinishEvent_RemoveLoadingUI.cs
  33. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/LoadingFinishEvent_RemoveLoadingUI.cs.meta
  34. 0 33
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/UILoadingComponentSystem.cs
  35. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/UILoadingComponentSystem.cs.meta
  36. 0 33
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/UILoadingEvent.cs
  37. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/UILoadingEvent.cs.meta
  38. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby.meta
  39. 0 12
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/LoginFinish_CreateLobbyUI.cs
  40. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/LoginFinish_CreateLobbyUI.cs.meta
  41. 0 26
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/UILobbyComponentSystem.cs
  42. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/UILobbyComponentSystem.cs.meta
  43. 0 26
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/UILobbyEvent.cs
  44. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/UILobbyEvent.cs.meta
  45. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin.meta
  46. 0 12
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs
  47. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs.meta
  48. 0 12
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/LoginFinish_RemoveLoginUI.cs
  49. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/LoginFinish_RemoveLoginUI.cs.meta
  50. 0 34
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/UILoginComponentSystem.cs
  51. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/UILoginComponentSystem.cs.meta
  52. 0 24
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/UILoginEvent.cs
  53. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/UILoginEvent.cs.meta
  54. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit.meta
  55. 0 21
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/AfterUnitCreate_CreateUnitView.cs
  56. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/AfterUnitCreate_CreateUnitView.cs.meta
  57. 0 219
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/AnimatorComponentSystem.cs
  58. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/AnimatorComponentSystem.cs.meta
  59. 0 19
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/ChangePosition_SyncGameObjectPos.cs
  60. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/ChangePosition_SyncGameObjectPos.cs.meta
  61. 0 19
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/ChangeRotation_SyncGameObjectRotation.cs
  62. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/ChangeRotation_SyncGameObjectRotation.cs.meta
  63. 0 16
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/GameObjectComponentSystem.cs
  64. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/GameObjectComponentSystem.cs.meta
  65. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module.meta
  66. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/Resource.meta
  67. 0 20
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/Resource/GameObjectHelper.cs
  68. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/Resource/GameObjectHelper.cs.meta
  69. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI.meta
  70. 0 37
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI/UIComponentSystem.cs
  71. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI/UIComponentSystem.cs.meta
  72. 0 69
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI/UIEventComponentSystem.cs
  73. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI/UIEventComponentSystem.cs.meta
  74. 0 27
      GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Entry.cs
  75. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Entry.cs.meta
  76. 0 8
      GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource.meta
  77. 0 616
      GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource/ResourcesComponent.cs
  78. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource/ResourcesComponent.cs.meta
  79. 0 83
      GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource/ResourcesLoaderComponent.cs
  80. 0 11
      GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource/ResourcesLoaderComponent.cs.meta
  81. 4 0
      GameClient/Assets/Game/HotUpdate/GameGlobal.cs
  82. 20 2
      GameClient/Assets/Game/HotUpdate/HotUpdateEntry.cs
  83. 21 11
      GameClient/Assets/Game/Launcher/GameLauncher.cs
  84. 69 0
      GameClient/Assets/Game/Launcher/HotUpdateProxy/HotUpdateCodeLoader.cs
  85. 1 1
      GameClient/Assets/Game/Launcher/HotUpdateProxy/HotUpdateCodeLoader.cs.meta
  86. 27 0
      GameClient/Assets/Game/Launcher/HotUpdateProxy/HotUpdateProxy.cs
  87. 1 1
      GameClient/Assets/Game/Launcher/HotUpdateProxy/HotUpdateProxy.cs.meta
  88. 2 1
      GameClient/Assets/Game/Launcher/ILRuntime/ILRuntimeLauncher.cs
  89. 4 44
      GameClient/Assets/Game/Launcher/Version/VersionController.cs

+ 4 - 16
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/AppStart_Init.cs

@@ -1,3 +1,5 @@
+using GFGGame;
+
 namespace ET
 {
     public class AppStart_Init: AEvent<EventType.AppStart>
@@ -6,29 +8,15 @@ namespace ET
         {
             Game.Scene.AddComponent<TimerComponent>();
             Game.Scene.AddComponent<CoroutineLockComponent>();
-
-            // 加载配置
-            Game.Scene.AddComponent<ResourcesComponent>();
-            await ResourcesComponent.Instance.LoadBundleAsync("config.unity3d");
-            Game.Scene.AddComponent<ConfigComponent>();
-            ConfigComponent.Instance.Load();
-            ResourcesComponent.Instance.UnloadBundle("config.unity3d");
-            
             Game.Scene.AddComponent<OpcodeTypeComponent>();
             Game.Scene.AddComponent<MessageDispatcherComponent>();
             
             Game.Scene.AddComponent<NetThreadComponent>();
             Game.Scene.AddComponent<SessionStreamDispatcher>();
             Game.Scene.AddComponent<ZoneSceneManagerComponent>();
-            
-            Game.Scene.AddComponent<GlobalComponent>();
 
-            Game.Scene.AddComponent<AIDispatcherComponent>();
-            await ResourcesComponent.Instance.LoadBundleAsync("unit.unity3d");
-            
-            Scene zoneScene = SceneFactory.CreateZoneScene(1, "Game", Game.Scene);
-            
-            await Game.EventSystem.PublishAsync(new EventType.AppStartInitFinish() { ZoneScene = zoneScene });
+            GameGlobal.zoneScene = SceneFactory.CreateZoneScene(1, "Game", Game.Scene);
+            ET.Log.Trace("AppStart end");
         }
     }
 }

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config.meta

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

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config/ConfigComponent_SetConfigLoader_Awake.cs

@@ -1,11 +0,0 @@
-namespace ET
-{
-    [ObjectSystem]
-    public class ConfigComponent_SetConfigLoader_Awake: AwakeSystem<ConfigComponent>
-    {
-        public override void Awake(ConfigComponent self)
-        {
-            self.ConfigLoader = new ConfigLoader();
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config/ConfigComponent_SetConfigLoader_Awake.cs.meta

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

+ 0 - 26
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config/ConfigLoader.cs

@@ -1,26 +0,0 @@
-using System.Collections.Generic;
-using UnityEngine;
-
-namespace ET
-{
-    public class ConfigLoader: IConfigLoader
-    {
-        public void GetAllConfigBytes(Dictionary<string, byte[]> output)
-        {
-            Dictionary<string, UnityEngine.Object> keys = ResourcesComponent.Instance.GetBundleAll("config.unity3d");
-
-            foreach (var kv in keys)
-            {
-                TextAsset v = kv.Value as TextAsset;
-                string key = kv.Key;
-                output[key] = v.bytes;
-            }
-        }
-
-        public byte[] GetOneConfigBytes(string configName)
-        {
-            TextAsset v = ResourcesComponent.Instance.GetAsset("config.unity3d", configName) as TextAsset;
-            return v.bytes;
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Config/ConfigLoader.cs.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Global.meta

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

+ 0 - 17
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Global/GlobalComponentSystem.cs

@@ -1,17 +0,0 @@
-using UnityEngine;
-
-namespace ET
-{
-    [ObjectSystem]
-    public class GlobalComponentAwakeSystem: AwakeSystem<GlobalComponent>
-    {
-        public override void Awake(GlobalComponent self)
-        {
-            GlobalComponent.Instance = self;
-            
-            self.Global = GameObject.Find("/Global").transform;
-            self.Unit = GameObject.Find("/Global/Unit").transform;
-            self.UI = GameObject.Find("/Global/UI").transform;
-        }
-    }
-}

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Opera.meta

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

+ 0 - 57
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Opera/OperaComponentSystem.cs

@@ -1,57 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET
-{
-    [ObjectSystem]
-    public class OperaComponentAwakeSystem : AwakeSystem<OperaComponent>
-    {
-        public override void Awake(OperaComponent self)
-        {
-            self.mapMask = LayerMask.GetMask("Map");
-        }
-    }
-
-    [ObjectSystem]
-    public class OperaComponentUpdateSystem : UpdateSystem<OperaComponent>
-    {
-        public override void Update(OperaComponent self)
-        {
-            self.Update();
-        }
-    }
-    
-    public static class OperaComponentSystem
-    {
-        public static void Update(this OperaComponent self)
-        {
-            if (Input.GetMouseButtonDown(1))
-            {
-                Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
-                RaycastHit hit;
-                if (Physics.Raycast(ray, out hit, 1000, self.mapMask))
-                {
-                    self.ClickPoint = hit.point;
-                    self.frameClickMap.X = self.ClickPoint.x;
-                    self.frameClickMap.Y = self.ClickPoint.y;
-                    self.frameClickMap.Z = self.ClickPoint.z;
-                    self.ZoneScene().GetComponent<SessionComponent>().Session.Send(self.frameClickMap);
-                }
-            }
-
-            if (Input.GetKeyDown(KeyCode.R))
-            {
-                CodeLoader.Instance.LoadLogic();
-                Game.EventSystem.Add(CodeLoader.Instance.GetTypes());
-                Game.EventSystem.Load();
-                Log.Debug("hot reload success!");
-            }
-            
-            if (Input.GetKeyDown(KeyCode.T))
-            {
-                C2M_TransferMap c2MTransferMap = new C2M_TransferMap();
-                self.ZoneScene().GetComponent<SessionComponent>().Session.Call(c2MTransferMap).Coroutine();
-            }
-        }
-    }
-}

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene.meta

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

+ 0 - 13
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/AfterCreateCurrentScene_AddComponent.cs

@@ -1,13 +0,0 @@
-namespace ET
-{
-    public class AfterCreateCurrentScene_AddComponent: AEvent<EventType.AfterCreateCurrentScene>
-    {
-        protected override async ETTask Run(EventType.AfterCreateCurrentScene args)
-        {
-            Scene currentScene = args.CurrentScene;
-            currentScene.AddComponent<UIComponent>();
-            currentScene.AddComponent<ResourcesLoaderComponent>();
-            await ETTask.CompletedTask;
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/AfterCreateCurrentScene_AddComponent.cs.meta

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

+ 0 - 14
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/AfterCreateZoneScene_AddComponent.cs

@@ -1,14 +0,0 @@
-namespace ET
-{
-    public class AfterCreateZoneScene_AddComponent: AEvent<EventType.AfterCreateZoneScene>
-    {
-        protected override async ETTask Run(EventType.AfterCreateZoneScene args)
-        {
-            Scene zoneScene = args.ZoneScene;
-            zoneScene.AddComponent<UIEventComponent>();
-            zoneScene.AddComponent<UIComponent>();
-            zoneScene.AddComponent<ResourcesLoaderComponent>();
-            await ETTask.CompletedTask;
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/AfterCreateZoneScene_AddComponent.cs.meta

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

+ 0 - 55
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/SceneChangeComponentSystem.cs

@@ -1,55 +0,0 @@
-using UnityEngine.SceneManagement;
-
-namespace ET
-{
-    public class SceneChangeComponentUpdateSystem: UpdateSystem<SceneChangeComponent>
-    {
-        public override void Update(SceneChangeComponent self)
-        {
-            if (!self.loadMapOperation.isDone)
-            {
-                return;
-            }
-
-            if (self.tcs == null)
-            {
-                return;
-            }
-            
-            ETTask tcs = self.tcs;
-            self.tcs = null;
-            tcs.SetResult();
-        }
-    }
-	
-    
-    public class SceneChangeComponentDestroySystem: DestroySystem<SceneChangeComponent>
-    {
-        public override void Destroy(SceneChangeComponent self)
-        {
-            self.loadMapOperation = null;
-            self.tcs = null;
-        }
-    }
-
-    public static class SceneChangeComponentSystem
-    {
-        public static async ETTask ChangeSceneAsync(this SceneChangeComponent self, string sceneName)
-        {
-            self.tcs = ETTask.Create(true);
-            // 加载map
-            self.loadMapOperation = SceneManager.LoadSceneAsync(sceneName);
-            //this.loadMapOperation.allowSceneActivation = false;
-            await self.tcs;
-        }
-        
-        public static int Process(this SceneChangeComponent self)
-        {
-            if (self.loadMapOperation == null)
-            {
-                return 0;
-            }
-            return (int)(self.loadMapOperation.progress * 100);
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/SceneChangeComponentSystem.cs.meta

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

+ 0 - 30
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/SceneChangeStart_AddComponent.cs

@@ -1,30 +0,0 @@
-namespace ET
-{
-    public class SceneChangeStart_AddComponent: AEvent<EventType.SceneChangeStart>
-    {
-        protected override async ETTask Run(EventType.SceneChangeStart args)
-        {
-            Scene currentScene = args.ZoneScene.CurrentScene();
-            
-            // 加载场景资源
-            await ResourcesComponent.Instance.LoadBundleAsync($"{currentScene.Name}.unity3d");
-            // 切换到map场景
-
-            SceneChangeComponent sceneChangeComponent = null;
-            try
-            {
-                sceneChangeComponent = Game.Scene.AddComponent<SceneChangeComponent>();
-                {
-                    await sceneChangeComponent.ChangeSceneAsync(currentScene.Name);
-                }
-            }
-            finally
-            {
-                sceneChangeComponent?.Dispose();
-            }
-			
-
-            currentScene.AddComponent<OperaComponent>();
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Scene/SceneChangeStart_AddComponent.cs.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp.meta

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

+ 0 - 10
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp/SceneChangeFinishEvent_CreateUIHelp.cs

@@ -1,10 +0,0 @@
-namespace ET
-{
-    public class SceneChangeFinishEvent_CreateUIHelp : AEvent<EventType.SceneChangeFinish>
-    {
-        protected override async ETTask Run(EventType.SceneChangeFinish args)
-        {
-            await UIHelper.Create(args.CurrentScene, UIType.UIHelp, UILayer.Mid);
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp/SceneChangeFinishEvent_CreateUIHelp.cs.meta

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

+ 0 - 32
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp/UIHelpEvent.cs

@@ -1,32 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET
-{
-	[UIEvent(UIType.UIHelp)]
-    public class UIHelpEvent: AUIEvent
-    {
-        public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
-        {
-	        try
-	        {
-		        await uiComponent.Domain.GetComponent<ResourcesLoaderComponent>().LoadAsync(UIType.UIHelp.StringToAB());
-		        GameObject bundleGameObject = (GameObject) ResourcesComponent.Instance.GetAsset(UIType.UIHelp.StringToAB(), UIType.UIHelp);
-		        GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, UIEventComponent.Instance.UILayers[(int)uiLayer]);
-		        UI ui = uiComponent.AddChild<UI, string, GameObject>(UIType.UIHelp, gameObject);
-
-				ui.AddComponent<UIHelpComponent>();
-				return ui;
-	        }
-	        catch (Exception e)
-	        {
-				Log.Error(e);
-		        return null;
-	        }
-		}
-
-        public override void OnRemove(UIComponent uiComponent)
-        {
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelp/UIHelpEvent.cs.meta

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

+ 0 - 16
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelper.cs

@@ -1,16 +0,0 @@
-namespace ET
-{
-    public static class UIHelper
-    {
-        public static async ETTask<UI> Create(Scene scene, string uiType, UILayer uiLayer)
-        {
-            return await scene.GetComponent<UIComponent>().Create(uiType, uiLayer);
-        }
-        
-        public static async ETTask Remove(Scene scene, string uiType)
-        {
-            scene.GetComponent<UIComponent>().Remove(uiType);
-            await ETTask.CompletedTask;
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UIHelper.cs.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading.meta

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

+ 0 - 12
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/LoadingBeginEvent_CreateLoadingUI.cs

@@ -1,12 +0,0 @@
-using UnityEngine;
-
-namespace ET
-{
-    public class LoadingBeginEvent_CreateLoadingUI : AEvent<EventType.LoadingBegin>
-    {
-        protected override async ETTask Run(EventType.LoadingBegin args)
-        {
-            await UIHelper.Create(args.Scene, UIType.UILoading, UILayer.Mid);
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/LoadingBeginEvent_CreateLoadingUI.cs.meta

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

+ 0 - 10
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/LoadingFinishEvent_RemoveLoadingUI.cs

@@ -1,10 +0,0 @@
-namespace ET
-{
-    public class LoadingFinishEvent_RemoveLoadingUI : AEvent<EventType.LoadingFinish>
-    {
-        protected override async ETTask Run(EventType.LoadingFinish args)
-        {
-            await UIHelper.Create(args.Scene, UIType.UILoading, UILayer.Mid);
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/LoadingFinishEvent_RemoveLoadingUI.cs.meta

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

+ 0 - 33
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/UILoadingComponentSystem.cs

@@ -1,33 +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>().GameObject.Get<GameObject>("Text").GetComponent<Text>();
-            self.StartAsync().Coroutine();
-        }
-    }
-
-    public static class UiLoadingComponentSystem
-    {
-        public static async ETTask StartAsync(this UILoadingComponent self)
-        {
-            long instanceId = self.InstanceId;
-            while (true)
-            {
-                await TimerComponent.Instance.WaitAsync(1000);
-
-                if (self.InstanceId != instanceId)
-                {
-                    return;
-                }
-            }
-        }
-    }
-
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/UILoadingComponentSystem.cs.meta

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

+ 0 - 33
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/UILoadingEvent.cs

@@ -1,33 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET
-{
-	[UIEvent(UIType.UILoading)]
-    public class UILoadingEvent: AUIEvent
-    {
-        public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
-        {
-	        try
-	        {
-		        await ETTask.CompletedTask;
-				GameObject bundleGameObject = ((GameObject)Resources.Load("KV")).Get<GameObject>(UIType.UILoading);
-				GameObject go = UnityEngine.Object.Instantiate(bundleGameObject);
-				go.layer = LayerMask.NameToLayer(LayerNames.UI);
-				UI ui = uiComponent.AddChild<UI, string, GameObject>(UIType.UILoading, go);
-
-				ui.AddComponent<UILoadingComponent>();
-				return ui;
-	        }
-	        catch (Exception e)
-	        {
-				Log.Error(e);
-		        return null;
-	        }
-		}
-
-        public override void OnRemove(UIComponent uiComponent)
-        {
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILoading/UILoadingEvent.cs.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby.meta

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

+ 0 - 12
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/LoginFinish_CreateLobbyUI.cs

@@ -1,12 +0,0 @@
-
-
-namespace ET
-{
-	public class LoginFinish_CreateLobbyUI: AEvent<EventType.LoginFinish>
-	{
-		protected override async ETTask Run(EventType.LoginFinish args)
-		{
-			await UIHelper.Create(args.ZoneScene, UIType.UILobby, UILayer.Mid);
-		}
-	}
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/LoginFinish_CreateLobbyUI.cs.meta

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

+ 0 - 26
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/UILobbyComponentSystem.cs

@@ -1,26 +0,0 @@
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace ET
-{
-    [ObjectSystem]
-    public class UILobbyComponentAwakeSystem: AwakeSystem<UILobbyComponent>
-    {
-        public override void Awake(UILobbyComponent self)
-        {
-            ReferenceCollector rc = self.GetParent<UI>().GameObject.GetComponent<ReferenceCollector>();
-
-            self.enterMap = rc.Get<GameObject>("EnterMap");
-            self.enterMap.GetComponent<Button>().onClick.AddListener(() => { self.EnterMap().Coroutine(); });
-        }
-    }
-
-    public static class UILobbyComponentSystem
-    {
-        public static async ETTask EnterMap(this UILobbyComponent self)
-        {
-            await EnterMapHelper.EnterMapAsync(self.ZoneScene());
-            await UIHelper.Remove(self.ZoneScene(), UIType.UILobby);
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/UILobbyComponentSystem.cs.meta

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

+ 0 - 26
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/UILobbyEvent.cs

@@ -1,26 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET
-{
-    [UIEvent(UIType.UILobby)]
-    public class UILobbyEvent: AUIEvent
-    {
-        public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
-        {
-            await ETTask.CompletedTask;
-            await uiComponent.Domain.GetComponent<ResourcesLoaderComponent>().LoadAsync(UIType.UILobby.StringToAB());
-            GameObject bundleGameObject = (GameObject) ResourcesComponent.Instance.GetAsset(UIType.UILobby.StringToAB(), UIType.UILobby);
-            GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, UIEventComponent.Instance.UILayers[(int)uiLayer]);
-            UI ui = uiComponent.AddChild<UI, string, GameObject>(UIType.UILobby, gameObject);
-
-            ui.AddComponent<UILobbyComponent>();
-            return ui;
-        }
-
-        public override void OnRemove(UIComponent uiComponent)
-        {
-            ResourcesComponent.Instance.UnloadBundle(UIType.UILobby.StringToAB());
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILobby/UILobbyEvent.cs.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin.meta

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

+ 0 - 12
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs

@@ -1,12 +0,0 @@
-
-
-namespace ET
-{
-	public class AppStartInitFinish_CreateLoginUI: AEvent<EventType.AppStartInitFinish>
-	{
-		protected override async ETTask Run(EventType.AppStartInitFinish args)
-		{
-			await UIHelper.Create(args.ZoneScene, UIType.UILogin, UILayer.Mid);
-		}
-	}
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs.meta

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

+ 0 - 12
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/LoginFinish_RemoveLoginUI.cs

@@ -1,12 +0,0 @@
-
-
-namespace ET
-{
-	public class LoginFinish_RemoveLoginUI: AEvent<EventType.LoginFinish>
-	{
-		protected override async ETTask Run(EventType.LoginFinish args)
-		{
-			await UIHelper.Remove(args.ZoneScene, UIType.UILogin);
-		}
-	}
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/LoginFinish_RemoveLoginUI.cs.meta

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

+ 0 - 34
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/UILoginComponentSystem.cs

@@ -1,34 +0,0 @@
-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>().GameObject.GetComponent<ReferenceCollector>();
-			self.loginBtn = rc.Get<GameObject>("LoginBtn");
-			
-			self.loginBtn.GetComponent<Button>().onClick.AddListener(()=> { self.OnLogin(); });
-			self.account = rc.Get<GameObject>("Account");
-			self.password = rc.Get<GameObject>("Password");
-		}
-	}
-	
-	public static class UILoginComponentSystem
-	{
-		public static void OnLogin(this UILoginComponent self)
-		{
-			LoginHelper.Login(
-				self.DomainScene(), 
-				ConstValue.LoginAddress, 
-				self.account.GetComponent<InputField>().text, 
-				self.password.GetComponent<InputField>().text).Coroutine();
-		}
-	}
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/UILoginComponentSystem.cs.meta

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

+ 0 - 24
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/UILoginEvent.cs

@@ -1,24 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET
-{
-    [UIEvent(UIType.UILogin)]
-    public class UILoginEvent: AUIEvent
-    {
-        public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
-        {
-            await uiComponent.Domain.GetComponent<ResourcesLoaderComponent>().LoadAsync(UIType.UILogin.StringToAB());
-            GameObject bundleGameObject = (GameObject) ResourcesComponent.Instance.GetAsset(UIType.UILogin.StringToAB(), UIType.UILogin);
-            GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, UIEventComponent.Instance.UILayers[(int)uiLayer]);
-            UI ui = uiComponent.AddChild<UI, string, GameObject>(UIType.UILogin, gameObject);
-            ui.AddComponent<UILoginComponent>();
-            return ui;
-        }
-
-        public override void OnRemove(UIComponent uiComponent)
-        {
-            ResourcesComponent.Instance.UnloadBundle(UIType.UILogin.StringToAB());
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/UI/UILogin/UILoginEvent.cs.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit.meta

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

+ 0 - 21
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/AfterUnitCreate_CreateUnitView.cs

@@ -1,21 +0,0 @@
-using UnityEngine;
-
-namespace ET
-{
-    public class AfterUnitCreate_CreateUnitView: AEvent<EventType.AfterUnitCreate>
-    {
-        protected override async ETTask Run(EventType.AfterUnitCreate args)
-        {
-            // Unit View层
-            // 这里可以改成异步加载,demo就不搞了
-            GameObject bundleGameObject = (GameObject)ResourcesComponent.Instance.GetAsset("Unit.unity3d", "Unit");
-            GameObject prefab = bundleGameObject.Get<GameObject>("Skeleton");
-	        
-            GameObject go = UnityEngine.Object.Instantiate(prefab, GlobalComponent.Instance.Unit, true);
-            go.transform.position = args.Unit.Position;
-            args.Unit.AddComponent<GameObjectComponent>().GameObject = go;
-            args.Unit.AddComponent<AnimatorComponent>();
-            await ETTask.CompletedTask;
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/AfterUnitCreate_CreateUnitView.cs.meta

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

+ 0 - 219
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/AnimatorComponentSystem.cs

@@ -1,219 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET
-{
-	[ObjectSystem]
-	public class AnimatorComponentAwakeSystem : AwakeSystem<AnimatorComponent>
-	{
-		public override void Awake(AnimatorComponent self)
-		{
-			self.Awake();
-		}
-	}
-
-	[ObjectSystem]
-	public class AnimatorComponentUpdateSystem : UpdateSystem<AnimatorComponent>
-	{
-		public override void Update(AnimatorComponent self)
-		{
-			self.Update();
-		}
-	}
-	
-	[ObjectSystem]
-	public class AnimatorComponentDestroySystem : DestroySystem<AnimatorComponent>
-	{
-		public override void Destroy(AnimatorComponent self)
-		{
-			self.animationClips = null;
-			self.Parameter = null;
-			self.Animator = null;
-		}
-	}
-
-	public static class AnimatorComponentSystem
-	{
-		public static void Awake(this AnimatorComponent self)
-		{
-			Animator animator = self.Parent.GetComponent<GameObjectComponent>().GameObject.GetComponent<Animator>();
-
-			if (animator == null)
-			{
-				return;
-			}
-
-			if (animator.runtimeAnimatorController == null)
-			{
-				return;
-			}
-
-			if (animator.runtimeAnimatorController.animationClips == null)
-			{
-				return;
-			}
-			self.Animator = animator;
-			foreach (AnimationClip animationClip in animator.runtimeAnimatorController.animationClips)
-			{
-				self.animationClips[animationClip.name] = animationClip;
-			}
-			foreach (AnimatorControllerParameter animatorControllerParameter in animator.parameters)
-			{
-				self.Parameter.Add(animatorControllerParameter.name);
-			}
-		}
-
-		public static void Update(this AnimatorComponent self)
-		{
-			if (self.isStop)
-			{
-				return;
-			}
-
-			if (self.MotionType == MotionType.None)
-			{
-				return;
-			}
-
-			try
-			{
-				self.Animator.SetFloat("MotionSpeed", self.MontionSpeed);
-
-				self.Animator.SetTrigger(self.MotionType.ToString());
-
-				self.MontionSpeed = 1;
-				self.MotionType = MotionType.None;
-			}
-			catch (Exception ex)
-			{
-				throw new Exception($"动作播放失败: {self.MotionType}", ex);
-			}
-		}
-
-		public static bool HasParameter(this AnimatorComponent self, string parameter)
-		{
-			return self.Parameter.Contains(parameter);
-		}
-
-		public static void PlayInTime(this AnimatorComponent self, MotionType motionType, float time)
-		{
-			AnimationClip animationClip;
-			if (!self.animationClips.TryGetValue(motionType.ToString(), out animationClip))
-			{
-				throw new Exception($"找不到该动作: {motionType}");
-			}
-
-			float motionSpeed = animationClip.length / time;
-			if (motionSpeed < 0.01f || motionSpeed > 1000f)
-			{
-				Log.Error($"motionSpeed数值异常, {motionSpeed}, 此动作跳过");
-				return;
-			}
-			self.MotionType = motionType;
-			self.MontionSpeed = motionSpeed;
-		}
-
-		public static void Play(this AnimatorComponent self, MotionType motionType, float motionSpeed = 1f)
-		{
-			if (!self.HasParameter(motionType.ToString()))
-			{
-				return;
-			}
-			self.MotionType = motionType;
-			self.MontionSpeed = motionSpeed;
-		}
-
-		public static float AnimationTime(this AnimatorComponent self, MotionType motionType)
-		{
-			AnimationClip animationClip;
-			if (!self.animationClips.TryGetValue(motionType.ToString(), out animationClip))
-			{
-				throw new Exception($"找不到该动作: {motionType}");
-			}
-			return animationClip.length;
-		}
-
-		public static void PauseAnimator(this AnimatorComponent self)
-		{
-			if (self.isStop)
-			{
-				return;
-			}
-			self.isStop = true;
-
-			if (self.Animator == null)
-			{
-				return;
-			}
-			self.stopSpeed = self.Animator.speed;
-			self.Animator.speed = 0;
-		}
-
-		public static void RunAnimator(this AnimatorComponent self)
-		{
-			if (!self.isStop)
-			{
-				return;
-			}
-
-			self.isStop = false;
-
-			if (self.Animator == null)
-			{
-				return;
-			}
-			self.Animator.speed = self.stopSpeed;
-		}
-
-		public static void SetBoolValue(this AnimatorComponent self, string name, bool state)
-		{
-			if (!self.HasParameter(name))
-			{
-				return;
-			}
-
-			self.Animator.SetBool(name, state);
-		}
-
-		public static void SetFloatValue(this AnimatorComponent self, string name, float state)
-		{
-			if (!self.HasParameter(name))
-			{
-				return;
-			}
-
-			self.Animator.SetFloat(name, state);
-		}
-
-		public static void SetIntValue(this AnimatorComponent self, string name, int value)
-		{
-			if (!self.HasParameter(name))
-			{
-				return;
-			}
-
-			self.Animator.SetInteger(name, value);
-		}
-
-		public static void SetTrigger(this AnimatorComponent self, string name)
-		{
-			if (!self.HasParameter(name))
-			{
-				return;
-			}
-
-			self.Animator.SetTrigger(name);
-		}
-
-		public static void SetAnimatorSpeed(this AnimatorComponent self, float speed)
-		{
-			self.stopSpeed = self.Animator.speed;
-			self.Animator.speed = speed;
-		}
-
-		public static void ResetAnimatorSpeed(this AnimatorComponent self)
-		{
-			self.Animator.speed = self.stopSpeed;
-		}
-	}
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/AnimatorComponentSystem.cs.meta

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

+ 0 - 19
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/ChangePosition_SyncGameObjectPos.cs

@@ -1,19 +0,0 @@
-using UnityEngine;
-
-namespace ET
-{
-    public class ChangePosition_SyncGameObjectPos: AEvent<EventType.ChangePosition>
-    {
-        protected override async ETTask Run(EventType.ChangePosition args)
-        {
-            GameObjectComponent gameObjectComponent = args.Unit.GetComponent<GameObjectComponent>();
-            if (gameObjectComponent == null)
-            {
-                return;
-            }
-            Transform transform = gameObjectComponent.GameObject.transform;
-            transform.position = args.Unit.Position;
-            await ETTask.CompletedTask;
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/ChangePosition_SyncGameObjectPos.cs.meta

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

+ 0 - 19
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/ChangeRotation_SyncGameObjectRotation.cs

@@ -1,19 +0,0 @@
-using UnityEngine;
-
-namespace ET
-{
-    public class ChangeRotation_SyncGameObjectRotation: AEvent<EventType.ChangeRotation>
-    {
-        protected override async ETTask Run(EventType.ChangeRotation args)
-        {
-            GameObjectComponent gameObjectComponent = args.Unit.GetComponent<GameObjectComponent>();
-            if (gameObjectComponent == null)
-            {
-                return;
-            }
-            Transform transform = gameObjectComponent.GameObject.transform;
-            transform.rotation = args.Unit.Rotation;
-            await ETTask.CompletedTask;
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/ChangeRotation_SyncGameObjectRotation.cs.meta

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

+ 0 - 16
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/GameObjectComponentSystem.cs

@@ -1,16 +0,0 @@
-using System;
-
-namespace ET
-{
-    public static class GameObjectComponentSystem
-    {
-        [ObjectSystem]
-        public class DestroySystem: DestroySystem<GameObjectComponent>
-        {
-            public override void Destroy(GameObjectComponent self)
-            {
-                UnityEngine.Object.Destroy(self.GameObject);
-            }
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Unit/GameObjectComponentSystem.cs.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/Resource.meta

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

+ 0 - 20
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/Resource/GameObjectHelper.cs

@@ -1,20 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET
-{
-	public static class GameObjectHelper
-	{
-		public static T Get<T>(this GameObject gameObject, string key) where T : class
-		{
-			try
-			{
-				return gameObject.GetComponent<ReferenceCollector>().Get<T>(key);
-			}
-			catch (Exception e)
-			{
-				throw new Exception($"获取{gameObject.name}的ReferenceCollector key失败, key: {key}", e);
-			}
-		}
-	}
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/Resource/GameObjectHelper.cs.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI.meta

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

+ 0 - 37
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI/UIComponentSystem.cs

@@ -1,37 +0,0 @@
-using System.Collections.Generic;
-
-namespace ET
-{
-	/// <summary>
-	/// 管理Scene上的UI
-	/// </summary>
-	public static class UIComponentSystem
-	{
-		public static async ETTask<UI> Create(this UIComponent self, string uiType, UILayer uiLayer)
-		{
-			UI ui = await UIEventComponent.Instance.OnCreate(self, uiType, uiLayer);
-			self.UIs.Add(uiType, ui);
-			return ui;
-		}
-
-		public static void Remove(this UIComponent self, string uiType)
-		{
-			if (!self.UIs.TryGetValue(uiType, out UI ui))
-			{
-				return;
-			}
-			
-			UIEventComponent.Instance.OnRemove(self, uiType);
-			
-			self.UIs.Remove(uiType);
-			ui.Dispose();
-		}
-
-		public static UI Get(this UIComponent self, string name)
-		{
-			UI ui = null;
-			self.UIs.TryGetValue(name, out ui);
-			return ui;
-		}
-	}
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI/UIComponentSystem.cs.meta

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

+ 0 - 69
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI/UIEventComponentSystem.cs

@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-
-namespace ET
-{
-	[ObjectSystem]
-	public class UIEventComponentAwakeSystem : AwakeSystem<UIEventComponent>
-	{
-		public override void Awake(UIEventComponent self)
-		{
-			UIEventComponent.Instance = self;
-			
-			GameObject uiRoot = GameObject.Find("/Global/UI");
-			ReferenceCollector referenceCollector = uiRoot.GetComponent<ReferenceCollector>();
-			
-			self.UILayers.Add((int)UILayer.Hidden, referenceCollector.Get<GameObject>(UILayer.Hidden.ToString()).transform);
-			self.UILayers.Add((int)UILayer.Low, referenceCollector.Get<GameObject>(UILayer.Low.ToString()).transform);
-			self.UILayers.Add((int)UILayer.Mid, referenceCollector.Get<GameObject>(UILayer.Mid.ToString()).transform);
-			self.UILayers.Add((int)UILayer.High, referenceCollector.Get<GameObject>(UILayer.High.ToString()).transform);
-
-			var uiEvents = Game.EventSystem.GetTypes(typeof (UIEventAttribute));
-			foreach (Type type in uiEvents)
-			{
-				object[] attrs = type.GetCustomAttributes(typeof(UIEventAttribute), false);
-				if (attrs.Length == 0)
-				{
-					continue;
-				}
-
-				UIEventAttribute uiEventAttribute = attrs[0] as UIEventAttribute;
-				AUIEvent aUIEvent = Activator.CreateInstance(type) as AUIEvent;
-				self.UIEvents.Add(uiEventAttribute.UIType, aUIEvent);
-			}
-		}
-	}
-	
-	/// <summary>
-	/// 管理所有UI GameObject 以及UI事件
-	/// </summary>
-	public static class UIEventComponentSystem
-	{
-		public static async ETTask<UI> OnCreate(this UIEventComponent self, UIComponent uiComponent, string uiType, UILayer uiLayer)
-		{
-			try
-			{
-				UI ui = await self.UIEvents[uiType].OnCreate(uiComponent, uiLayer);
-				return ui;
-			}
-			catch (Exception e)
-			{
-				throw new Exception($"on create ui error: {uiType}", e);
-			}
-		}
-		
-		public static void OnRemove(this UIEventComponent self, UIComponent uiComponent, string uiType)
-		{
-			try
-			{
-				self.UIEvents[uiType].OnRemove(uiComponent);
-			}
-			catch (Exception e)
-			{
-				throw new Exception($"on remove ui error: {uiType}", e);
-			}
-			
-		}
-	}
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Module/UI/UIEventComponentSystem.cs.meta

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

+ 0 - 27
GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Entry.cs

@@ -1,27 +0,0 @@
-using System;
-
-namespace ET
-{
-	public static class Entry
-	{
-		public static void Start()
-		{
-			try
-			{
-				CodeLoader.Instance.Update += Game.Update;
-				CodeLoader.Instance.LateUpdate += Game.LateUpdate;
-				CodeLoader.Instance.OnApplicationQuit += Game.Close;
-				
-				
-				Game.EventSystem.Add(CodeLoader.Instance.GetTypes());
-
-				
-				Game.EventSystem.Publish(new EventType.AppStart());
-			}
-			catch (Exception e)
-			{
-				Log.Error(e);
-			}
-		}
-	}
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Entry.cs.meta

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

+ 0 - 8
GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource.meta

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

+ 0 - 616
GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource/ResourcesComponent.cs

@@ -1,616 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using UnityEngine;
-
-namespace ET
-{
-    [ObjectSystem]
-    public class ABInfoAwakeSystem: AwakeSystem<ABInfo, string, AssetBundle>
-    {
-        public override void Awake(ABInfo self, string abName, AssetBundle a)
-        {
-            self.AssetBundle = a;
-            self.Name = abName;
-            self.RefCount = 1;
-            self.AlreadyLoadAssets = false;
-        }
-    }
-
-    [ObjectSystem]
-    public class ABInfoDestroySystem: DestroySystem<ABInfo>
-    {
-        public override void Destroy(ABInfo self)
-        {
-            //Log.Debug($"desdroy assetbundle: {this.Name}");
-
-            self.RefCount = 0;
-            self.Name = "";
-            self.AlreadyLoadAssets = false;
-            self.AssetBundle = null;
-        }
-    }
-
-    public class ABInfo: Entity, IAwake<string, AssetBundle>, IDestroy
-    {
-        public string Name { get; set; }
-
-        public int RefCount { get; set; }
-
-        public AssetBundle AssetBundle;
-
-        public bool AlreadyLoadAssets;
-
-        public void Destroy(bool unload = true)
-        {
-            if (this.AssetBundle != null)
-            {
-                this.AssetBundle.Unload(unload);
-            }
-
-            this.Dispose();
-        }
-    }
-
-    // 用于字符串转换,减少GC
-    public static class AssetBundleHelper
-    {
-        public static async ETTask<AssetBundle> UnityLoadBundleAsync(string path)
-        {
-            var tcs = ETTask<AssetBundle>.Create(true);
-            AssetBundleCreateRequest request = AssetBundle.LoadFromFileAsync(path);
-            request.completed += operation => { tcs.SetResult(request.assetBundle); };
-            return await tcs;
-        }
-
-        public static async ETTask<UnityEngine.Object[]> UnityLoadAssetAsync(AssetBundle assetBundle)
-        {
-            var tcs = ETTask<UnityEngine.Object[]>.Create(true);
-            AssetBundleRequest request = assetBundle.LoadAllAssetsAsync();
-            request.completed += operation => { tcs.SetResult(request.allAssets); };
-            return await tcs;
-        }
-
-        public static string IntToString(this int value)
-        {
-            string result;
-            if (ResourcesComponent.Instance.IntToStringDict.TryGetValue(value, out result))
-            {
-                return result;
-            }
-
-            result = value.ToString();
-            ResourcesComponent.Instance.IntToStringDict[value] = result;
-            return result;
-        }
-
-        public static string StringToAB(this string value)
-        {
-            string result;
-            if (ResourcesComponent.Instance.StringToABDict.TryGetValue(value, out result))
-            {
-                return result;
-            }
-
-            result = value + ".unity3d";
-            ResourcesComponent.Instance.StringToABDict[value] = result;
-            return result;
-        }
-
-        public static string IntToAB(this int value)
-        {
-            return value.IntToString().StringToAB();
-        }
-
-        public static string BundleNameToLower(this string value)
-        {
-            string result;
-            if (ResourcesComponent.Instance.BundleNameToLowerDict.TryGetValue(value, out result))
-            {
-                return result;
-            }
-
-            result = value.ToLower();
-            ResourcesComponent.Instance.BundleNameToLowerDict[value] = result;
-            return result;
-        }
-    }
-
-    [ObjectSystem]
-    public class ResourcesComponentAwakeSystem: AwakeSystem<ResourcesComponent>
-    {
-        public override void Awake(ResourcesComponent self)
-        {
-            self.Awake();
-        }
-    }
-
-    public class ResourcesComponent: Entity, IAwake
-    {
-        public static ResourcesComponent Instance { get; set; }
-
-        private AssetBundleManifest AssetBundleManifestObject { get; set; }
-
-        public Dictionary<int, string> IntToStringDict = new Dictionary<int, string>();
-
-        public Dictionary<string, string> StringToABDict = new Dictionary<string, string>();
-
-        public Dictionary<string, string> BundleNameToLowerDict = new Dictionary<string, string>() { { "StreamingAssets", "StreamingAssets" } };
-
-        private readonly Dictionary<string, Dictionary<string, UnityEngine.Object>> resourceCache =
-                new Dictionary<string, Dictionary<string, UnityEngine.Object>>();
-
-        private readonly Dictionary<string, ABInfo> bundles = new Dictionary<string, ABInfo>();
-
-        public void Awake()
-        {
-            Instance = this;
-
-            if (Define.IsAsync)
-            {
-                LoadOneBundle("StreamingAssets");
-                AssetBundleManifestObject = (AssetBundleManifest)GetAsset("StreamingAssets", "AssetBundleManifest");
-            }
-        }
-
-        public override void Dispose()
-        {
-            if (this.IsDisposed)
-            {
-                return;
-            }
-
-            base.Dispose();
-
-            Instance = null;
-
-            foreach (var abInfo in this.bundles)
-            {
-                abInfo.Value.Destroy();
-            }
-
-            this.bundles.Clear();
-            this.resourceCache.Clear();
-            this.IntToStringDict.Clear();
-            this.StringToABDict.Clear();
-            this.BundleNameToLowerDict.Clear();
-        }
-
-        private string[] GetDependencies(string assetBundleName)
-        {
-            string[] dependencies = Array.Empty<string>();
-            if (DependenciesCache.TryGetValue(assetBundleName, out dependencies))
-            {
-                return dependencies;
-            }
-
-            if (!Define.IsAsync)
-            {
-                if (Define.IsEditor)
-                {
-                    dependencies = Define.GetAssetBundleDependencies(assetBundleName, true);
-                }
-            }
-            else
-            {
-                dependencies = this.AssetBundleManifestObject.GetAllDependencies(assetBundleName);
-            }
-
-            DependenciesCache.Add(assetBundleName, dependencies);
-            return dependencies;
-        }
-
-        private string[] GetSortedDependencies(string assetBundleName)
-        {
-            var info = new Dictionary<string, int>();
-            var parents = new List<string>();
-            CollectDependencies(parents, assetBundleName, info);
-            string[] ss = info.OrderBy(x => x.Value).Select(x => x.Key).ToArray();
-            return ss;
-        }
-
-        private void CollectDependencies(List<string> parents, string assetBundleName, Dictionary<string, int> info)
-        {
-            parents.Add(assetBundleName);
-            string[] deps = GetDependencies(assetBundleName);
-            foreach (string parent in parents)
-            {
-                if (!info.ContainsKey(parent))
-                {
-                    info[parent] = 0;
-                }
-
-                info[parent] += deps.Length;
-            }
-
-            foreach (string dep in deps)
-            {
-                if (parents.Contains(dep))
-                {
-                    throw new Exception($"包有循环依赖,请重新标记: {assetBundleName} {dep}");
-                }
-
-                CollectDependencies(parents, dep, info);
-            }
-
-            parents.RemoveAt(parents.Count - 1);
-        }
-
-        // 缓存包依赖,不用每次计算
-        private readonly Dictionary<string, string[]> DependenciesCache = new Dictionary<string, string[]>();
-
-        public bool Contains(string bundleName)
-        {
-            return this.bundles.ContainsKey(bundleName);
-        }
-
-        public Dictionary<string, UnityEngine.Object> GetBundleAll(string bundleName)
-        {
-            Dictionary<string, UnityEngine.Object> dict;
-            if (!this.resourceCache.TryGetValue(bundleName.BundleNameToLower(), out dict))
-            {
-                throw new Exception($"not found asset: {bundleName}");
-            }
-
-            return dict;
-        }
-
-        public UnityEngine.Object GetAsset(string bundleName, string prefab)
-        {
-            Dictionary<string, UnityEngine.Object> dict;
-            if (!this.resourceCache.TryGetValue(bundleName.BundleNameToLower(), out dict))
-            {
-                throw new Exception($"not found asset: {bundleName} {prefab}");
-            }
-
-            UnityEngine.Object resource = null;
-            if (!dict.TryGetValue(prefab, out resource))
-            {
-                throw new Exception($"not found asset: {bundleName} {prefab}");
-            }
-
-            return resource;
-        }
-
-        // 一帧卸载一个包,避免卡死
-        public async ETTask UnloadBundleAsync(string assetBundleName, bool unload = true)
-        {
-            assetBundleName = assetBundleName.BundleNameToLower();
-
-            string[] dependencies = GetSortedDependencies(assetBundleName);
-
-            //Log.Debug($"-----------dep unload start {assetBundleName} dep: {dependencies.ToList().ListToString()}");
-            foreach (string dependency in dependencies)
-            {
-                CoroutineLock coroutineLock = null;
-                try
-                {
-                    coroutineLock = await CoroutineLockComponent.Instance.Wait(CoroutineLockType.Resources, assetBundleName.GetHashCode());
-                    this.UnloadOneBundle(dependency, unload);
-                    await TimerComponent.Instance.WaitFrameAsync();
-                }
-                finally
-                {
-                    coroutineLock?.Dispose();
-                }
-            }
-            //Log.Debug($"-----------dep unload finish {assetBundleName} dep: {dependencies.ToList().ListToString()}");
-        }
-
-        // 只允许场景设置unload为false
-        public void UnloadBundle(string assetBundleName, bool unload = true)
-        {
-            assetBundleName = assetBundleName.BundleNameToLower();
-
-            string[] dependencies = GetSortedDependencies(assetBundleName);
-
-            //Log.Debug($"-----------dep unload start {assetBundleName} dep: {dependencies.ToList().ListToString()}");
-            foreach (string dependency in dependencies)
-            {
-                this.UnloadOneBundle(dependency, unload);
-            }
-
-            //Log.Debug($"-----------dep unload finish {assetBundleName} dep: {dependencies.ToList().ListToString()}");
-        }
-
-        private void UnloadOneBundle(string assetBundleName, bool unload = true)
-        {
-            assetBundleName = assetBundleName.BundleNameToLower();
-
-            ABInfo abInfo;
-            if (!this.bundles.TryGetValue(assetBundleName, out abInfo))
-            {
-                return;
-            }
-
-            //Log.Debug($"---------------unload one bundle {assetBundleName} refcount: {abInfo.RefCount - 1}");
-
-            --abInfo.RefCount;
-
-            if (abInfo.RefCount > 0)
-            {
-                return;
-            }
-
-            //Log.Debug($"---------------truly unload one bundle {assetBundleName} refcount: {abInfo.RefCount}");
-            this.bundles.Remove(assetBundleName);
-            this.resourceCache.Remove(assetBundleName);
-            abInfo.Destroy(unload);
-            // Log.Debug($"cache count: {this.cacheDictionary.Count}");
-        }
-
-        /// <summary>
-        /// 同步加载assetbundle
-        /// </summary>
-        /// <param name="assetBundleName"></param>
-        /// <returns></returns>
-        public void LoadBundle(string assetBundleName)
-        {
-            assetBundleName = assetBundleName.ToLower();
-
-            string[] dependencies = GetSortedDependencies(assetBundleName);
-            //Log.Debug($"-----------dep load start {assetBundleName} dep: {dependencies.ToList().ListToString()}");
-            foreach (string dependency in dependencies)
-            {
-                if (string.IsNullOrEmpty(dependency))
-                {
-                    continue;
-                }
-
-                this.LoadOneBundle(dependency);
-            }
-
-            //Log.Debug($"-----------dep load finish {assetBundleName} dep: {dependencies.ToList().ListToString()}");
-        }
-
-        private void AddResource(string bundleName, string assetName, UnityEngine.Object resource)
-        {
-            Dictionary<string, UnityEngine.Object> dict;
-            if (!this.resourceCache.TryGetValue(bundleName.BundleNameToLower(), out dict))
-            {
-                dict = new Dictionary<string, UnityEngine.Object>();
-                this.resourceCache[bundleName] = dict;
-            }
-
-            dict[assetName] = resource;
-        }
-
-        private void LoadOneBundle(string assetBundleName)
-        {
-            assetBundleName = assetBundleName.BundleNameToLower();
-            ABInfo abInfo;
-            if (this.bundles.TryGetValue(assetBundleName, out abInfo))
-            {
-                ++abInfo.RefCount;
-                //Log.Debug($"---------------load one bundle {assetBundleName} refcount: {abInfo.RefCount}");
-                return;
-            }
-
-            if (!Define.IsAsync)
-            {
-                if (Define.IsEditor)
-                {
-                    string[] realPath = null;
-                    realPath = Define.GetAssetPathsFromAssetBundle(assetBundleName);
-                    foreach (string s in realPath)
-                    {
-                        string assetName = Path.GetFileNameWithoutExtension(s);
-                        UnityEngine.Object resource = Define.LoadAssetAtPath(s);
-                        AddResource(assetBundleName, assetName, resource);
-                    }
-
-                    if (realPath.Length > 0)
-                    {
-                        abInfo = this.AddChild<ABInfo, string, AssetBundle>(assetBundleName, null);
-                        this.bundles[assetBundleName] = abInfo;
-                        //Log.Debug($"---------------load one bundle {assetBundleName} refcount: {abInfo.RefCount}");
-                    }
-                    else
-                    {
-                        Log.Error($"assets bundle not found: {assetBundleName}");
-                    }
-                }
-
-                return;
-            }
-
-            string p = Path.Combine(PathHelper.AppHotfixResPath, assetBundleName);
-            AssetBundle assetBundle = null;
-            if (File.Exists(p))
-            {
-                assetBundle = AssetBundle.LoadFromFile(p);
-            }
-            else
-            {
-                p = Path.Combine(PathHelper.AppResPath, assetBundleName);
-                assetBundle = AssetBundle.LoadFromFile(p);
-            }
-
-            if (assetBundle == null)
-            {
-                // 获取资源的时候会抛异常,这个地方不直接抛异常,因为有些地方需要Load之后判断是否Load成功
-                Log.Warning($"assets bundle not found: {assetBundleName}");
-                return;
-            }
-
-            if (!assetBundle.isStreamedSceneAssetBundle)
-            {
-                // 异步load资源到内存cache住
-                var assets = assetBundle.LoadAllAssets();
-                foreach (UnityEngine.Object asset in assets)
-                {
-                    AddResource(assetBundleName, asset.name, asset);
-                }
-            }
-
-            abInfo = this.AddChild<ABInfo, string, AssetBundle>(assetBundleName, assetBundle);
-            this.bundles[assetBundleName] = abInfo;
-
-            //Log.Debug($"---------------load one bundle {assetBundleName} refcount: {abInfo.RefCount}");
-        }
-
-        /// <summary>
-        /// 异步加载assetbundle, 加载ab包分两部分,第一部分是从硬盘加载,第二部分加载all assets。两者不能同时并发
-        /// </summary>
-        public async ETTask LoadBundleAsync(string assetBundleName)
-        {
-            assetBundleName = assetBundleName.BundleNameToLower();
-
-            string[] dependencies = GetSortedDependencies(assetBundleName);
-            //Log.Debug($"-----------dep load async start {assetBundleName} dep: {dependencies.ToList().ListToString()}");
-
-            using (ListComponent<ABInfo> abInfos = ListComponent<ABInfo>.Create())
-            {
-                async ETTask LoadDependency(string dependency, List<ABInfo> abInfosList)
-                {
-                    CoroutineLock coroutineLock = null;
-                    try
-                    {
-                        coroutineLock = await CoroutineLockComponent.Instance.Wait(CoroutineLockType.Resources, dependency.GetHashCode());
-                        ABInfo abInfo = await this.LoadOneBundleAsync(dependency);
-                        if (abInfo == null || abInfo.RefCount > 1)
-                        {
-                            return;
-                        }
-
-                        abInfosList.Add(abInfo);
-                    }
-                    finally
-                    {
-                        coroutineLock?.Dispose();
-                    }
-                }
-
-                // LoadFromFileAsync部分可以并发加载
-                using (ListComponent<ETTask> tasks = ListComponent<ETTask>.Create())
-                {
-                    foreach (string dependency in dependencies)
-                    {
-                        tasks.Add(LoadDependency(dependency, abInfos));
-                    }
-                    await ETTaskHelper.WaitAll(tasks);
-
-                    // ab包从硬盘加载完成,可以再并发加载all assets
-                    tasks.Clear();
-                    foreach (ABInfo abInfo in abInfos)
-                    {
-                        tasks.Add(LoadOneBundleAllAssets(abInfo));
-                    }
-                    await ETTaskHelper.WaitAll(tasks);
-                }
-            }
-        }
-
-        private async ETTask<ABInfo> LoadOneBundleAsync(string assetBundleName)
-        {
-            assetBundleName = assetBundleName.BundleNameToLower();
-            ABInfo abInfo;
-            if (this.bundles.TryGetValue(assetBundleName, out abInfo))
-            {
-                ++abInfo.RefCount;
-                //Log.Debug($"---------------load one bundle {assetBundleName} refcount: {abInfo.RefCount}");
-                return null;
-            }
-            string p = "";
-            AssetBundle assetBundle = null;
-
-            if (!Define.IsAsync)
-            {
-                if (Define.IsEditor)
-                {
-                    string[] realPath = Define.GetAssetPathsFromAssetBundle(assetBundleName);
-                    foreach (string s in realPath)
-                    {
-                        string assetName = Path.GetFileNameWithoutExtension(s);
-                        UnityEngine.Object resource = Define.LoadAssetAtPath(s);
-                        AddResource(assetBundleName, assetName, resource);
-                    }
-
-                    if (realPath.Length > 0)
-                    {
-                        abInfo = this.AddChild<ABInfo, string, AssetBundle>(assetBundleName, null);
-                        this.bundles[assetBundleName] = abInfo;
-                        //Log.Debug($"---------------load one bundle {assetBundleName} refcount: {abInfo.RefCount}");
-                    }
-                    else
-                    {
-                        Log.Error("Bundle not exist! BundleName: " + assetBundleName);
-                    }
-
-                    // 编辑器模式也不能同步加载
-                    await TimerComponent.Instance.WaitAsync(100);
-
-                    return abInfo;
-                }
-            }
-            p = Path.Combine(PathHelper.AppHotfixResPath, assetBundleName);
-            if (!File.Exists(p))
-            {
-                p = Path.Combine(PathHelper.AppResPath, assetBundleName);
-            }
-            Log.Debug("Async load bundle BundleName : " + p);
-
-            // if (!File.Exists(p))
-            // {
-            //     Log.Error("Async load bundle not exist! BundleName : " + p);
-            //     return null;
-            // }
-            assetBundle = await AssetBundleHelper.UnityLoadBundleAsync(p);
-            if (assetBundle == null)
-            {
-                // 获取资源的时候会抛异常,这个地方不直接抛异常,因为有些地方需要Load之后判断是否Load成功
-                Log.Warning($"assets bundle not found: {assetBundleName}");
-                return null;
-            }
-            abInfo = this.AddChild<ABInfo, string, AssetBundle>(assetBundleName, assetBundle);
-            this.bundles[assetBundleName] = abInfo;
-            return abInfo;
-            //Log.Debug($"---------------load one bundle {assetBundleName} refcount: {abInfo.RefCount}");
-        }
-
-        // 加载ab包中的all assets
-        private async ETTask LoadOneBundleAllAssets(ABInfo abInfo)
-        {
-            CoroutineLock coroutineLock = null;
-            try
-            {
-                coroutineLock = await CoroutineLockComponent.Instance.Wait(CoroutineLockType.Resources, abInfo.Name.GetHashCode());
-
-                if (abInfo.IsDisposed || abInfo.AlreadyLoadAssets)
-                {
-                    return;
-                }
-
-                if (abInfo.AssetBundle != null && !abInfo.AssetBundle.isStreamedSceneAssetBundle)
-                {
-                    // 异步load资源到内存cache住
-                    var assets = await AssetBundleHelper.UnityLoadAssetAsync(abInfo.AssetBundle);
-
-                    foreach (UnityEngine.Object asset in assets)
-                    {
-                        AddResource(abInfo.Name, asset.name, asset);
-                    }
-                }
-
-                abInfo.AlreadyLoadAssets = true;
-            }
-            finally
-            {
-                coroutineLock?.Dispose();
-            }
-        }
-
-        public string DebugString()
-        {
-            StringBuilder sb = new StringBuilder();
-            foreach (ABInfo abInfo in this.bundles.Values)
-            {
-                sb.Append($"{abInfo.Name}:{abInfo.RefCount}\n");
-            }
-
-            return sb.ToString();
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource/ResourcesComponent.cs.meta

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

+ 0 - 83
GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource/ResourcesLoaderComponent.cs

@@ -1,83 +0,0 @@
-using System.Collections.Generic;
-
-namespace ET
-{
-    [ObjectSystem]
-    public class ResourcesLoaderComponentDestroySystem: DestroySystem<ResourcesLoaderComponent>
-    {
-        public override void Destroy(ResourcesLoaderComponent self)
-        {
-            async ETTask UnLoadAsync()
-            {
-                using (ListComponent<string> list = ListComponent<string>.Create())
-                {
-                    list.AddRange(self.LoadedResource);
-                    self.LoadedResource = null;
-
-                    if (TimerComponent.Instance == null)
-                    {
-                        return;
-                    }
-                    
-                    // 延迟5秒卸载包,因为包卸载是引用计数,5秒之内假如重新有逻辑加载了这个包,那么可以避免一次卸载跟加载
-                    await TimerComponent.Instance.WaitAsync(5000);
-
-                    foreach (string abName in list)
-                    {
-                        CoroutineLock coroutineLock = null;
-                        try
-                        {
-                            coroutineLock =
-                                    await CoroutineLockComponent.Instance.Wait(CoroutineLockType.ResourcesLoader, abName.GetHashCode(), 0);
-                            {
-                                if (ResourcesComponent.Instance == null)
-                                {
-                                    return;
-                                }
-
-                                await ResourcesComponent.Instance.UnloadBundleAsync(abName);
-                            }
-                        }
-                        finally
-                        {
-                            coroutineLock?.Dispose();
-                        }
-                    }
-                }
-            }
-
-            UnLoadAsync().Coroutine();
-        }
-    }
-    
-    public class ResourcesLoaderComponent: Entity, IAwake, IDestroy
-    {
-        public HashSet<string> LoadedResource = new HashSet<string>();
-
-        public async ETTask LoadAsync(string ab)
-        {
-            CoroutineLock coroutineLock = null;
-            try
-            {
-                coroutineLock = await CoroutineLockComponent.Instance.Wait(CoroutineLockType.ResourcesLoader, ab.GetHashCode(), 0);
-                if (this.IsDisposed)
-                {
-                    Log.Error($"resourceload already disposed {ab}");
-                    return;
-                }
-
-                if (this.LoadedResource.Contains(ab))
-                {
-                    return;
-                }
-
-                LoadedResource.Add(ab);
-                await ResourcesComponent.Instance.LoadBundleAsync(ab);
-            }
-            finally
-            {
-                coroutineLock?.Dispose();
-            }
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/ETView/ModelView/Demo/Resource/ResourcesLoaderComponent.cs.meta

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

+ 4 - 0
GameClient/Assets/Game/HotUpdate/GameGlobal.cs

@@ -18,6 +18,10 @@ namespace GFGGame
         public static string gameApiUrl;
         public static string gameApiUrlTest;
 
+        //ET
+        public static ET.Scene zoneScene;
+        public const string LoginAddress = "127.0.0.1:10002";
+
         public static void Init()
         {
             loginApiUrl = LauncherConfig.loginApiUrl;

+ 20 - 2
GameClient/Assets/Game/HotUpdate/HotUpdateEntry.cs

@@ -1,4 +1,6 @@
-using FairyGUI;
+using Assets.Game.Launcher.HotUpdateProxy;
+using ET;
+using FairyGUI;
 using System;
 using UnityEngine;
 namespace GFGGame.HotUpdate
@@ -6,10 +8,26 @@ namespace GFGGame.HotUpdate
     public class HotUpdateEntry
     {
 
-        public static void Start()
+        public static async void Start()
         {
             VEngine.Logger.Loggable = false;
             Debug.Log("HotUpdateEntry Start");
+            //ET
+            try
+            {
+                HotUpdateProxy.Instance.update = Game.Update;
+                HotUpdateProxy.Instance.lateUpdate = Game.LateUpdate;
+                HotUpdateProxy.Instance.onApplicationQuit = Game.Close;
+
+                Game.EventSystem.Add(HotUpdateCodeLoader.Instance.GetTypes());
+
+                Game.EventSystem.Publish(new ET.EventType.AppStart());
+
+            }
+            catch (Exception e)
+            {
+                Log.Error(e);
+            }
             ViewManager.Init();
             //日志
             LogController.Instance.Init();

+ 21 - 11
GameClient/Assets/Game/Launcher/GameLauncher.cs

@@ -2,9 +2,30 @@ using UnityEngine;
 using GFGGame;
 using FairyGUI;
 using System.Collections;
+using ET;
+using System.Threading;
 
 public class GameLauncher : MonoBehaviour
 {
+    private void Awake()
+    {
+        //ET
+        System.AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
+        {
+            Log.Error(e.ExceptionObject.ToString());
+        };
+
+        SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);
+
+        DontDestroyOnLoad(gameObject);
+
+        ETTask.ExceptionHandler += Log.Error;
+
+        Log.ILog = new UnityLogger();
+
+        Options.Instance = new Options();
+    }
+
     // Start is called before the first frame update
     void Start()
     {
@@ -13,17 +34,6 @@ public class GameLauncher : MonoBehaviour
         LauncherView.Instance.Open();
         LauncherView.Instance.SetDesc("正在初始化...");
         LauncherConfig.Init();
-
-
-        //StoreRequest storeRequest = new StoreRequest();
-        //storeRequest.Name = "aa";
-        //storeRequest.Num = 1;
-        //storeRequest.Result = 2;
-        //storeRequest.MyList.Add("bb");
-        //storeRequest.MyList.Add("cc");
-        //IMessage a = storeRequest;
-
-        //HttpProtobufTool.Instance.Post(GameGlobal.gameApiUrlTest, "test", a.ToByteArray(), null);
     }
 
 

+ 69 - 0
GameClient/Assets/Game/Launcher/HotUpdateProxy/HotUpdateCodeLoader.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections;
+using System.Reflection;
+using UnityEngine;
+using GFGGame.Launcher;
+
+namespace GFGGame
+{
+    public class HotUpdateCodeLoader : SingletonMonoBase<HotUpdateCodeLoader>
+    {
+        public Type[] allTypes;
+
+        public Type[] GetTypes()
+        {
+            return this.allTypes;
+        }
+
+        public void StartLoad()
+        {
+            StartCoroutine(StartLoadAssemblyHotfix());
+        }
+
+
+        IEnumerator StartLoadAssemblyHotfix()
+        {
+            Debug.LogFormat("ILRuntimeLauncher StartLoadAssemblyHotfix");
+            yield return new WaitForSeconds(0.1f);
+            var dllPath = "Assets/Res/Code/Game.HotUpdate.dll.bytes";
+            var asset = GFGAsset.Load<TextAsset>(dllPath);
+            byte[] assBytes = asset.bytes;
+            //Debug.LogFormat("assBytes != null {0}", assBytes != null);
+            //Debug.LogFormat("assBytes.Length {0}", assBytes.Length);
+            //yield return new WaitForSeconds(0.1f);
+            var pdbPath = "Assets/Res/Code/Game.HotUpdate.pdb.bytes";
+            asset = GFGAsset.Load<TextAsset>(pdbPath);
+            byte[] pdbBytes = asset.bytes;
+            //Debug.LogFormat("pdbBytes != null {0}", pdbBytes != null);
+            //Debug.LogFormat("pdbBytes.Length {0}", pdbBytes.Length);
+            if (LauncherConfig.ILRuntimeMode)
+            {
+                Debug.LogFormat("Assembly Mode ILRuntime");
+                ILRuntimeLauncher.Instance.LoadAssembly(assBytes, pdbBytes);
+            }
+            else
+            {
+                Debug.LogFormat("Assembly Mode Jit");
+                StartCoroutine(LoadAssemblyJustInTime(assBytes, pdbBytes));
+            }
+            GFGAsset.Release(dllPath);
+            GFGAsset.Release(pdbPath);
+        }
+
+        IEnumerator LoadAssemblyJustInTime(byte[] assBytes, byte[] pdbBytes)
+        {
+            //yield return new WaitForSeconds(0.1f);
+            //mono模式
+            var assembly = Assembly.Load(assBytes, pdbBytes);
+            this.allTypes = assembly.GetTypes();
+            //Debug.LogFormat("assembly != null {0}", assembly != null);
+            //yield return new WaitForSeconds(0.1f);
+            System.Type type = assembly.GetType("GFGGame.HotUpdate.HotUpdateEntry");
+            //Debug.LogFormat("type != null {0}", type != null);
+            //yield return new WaitForSeconds(0.1f);
+            type.GetMethod("Start").Invoke(type, null);
+            yield break;
+        }
+
+    }
+}

+ 1 - 1
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Global/GlobalComponentSystem.cs.meta → GameClient/Assets/Game/Launcher/HotUpdateProxy/HotUpdateCodeLoader.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: e1015d684e1475d408ac0f148540e086
+guid: 3a49d7dbbcef60445b7491164a9a5808
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 27 - 0
GameClient/Assets/Game/Launcher/HotUpdateProxy/HotUpdateProxy.cs

@@ -0,0 +1,27 @@
+using GFGGame.Launcher;
+using System;
+
+namespace Assets.Game.Launcher.HotUpdateProxy
+{
+    public class HotUpdateProxy : SingletonMonoBase<HotUpdateProxy>
+    {
+        public Action update;
+        public Action lateUpdate;
+        public Action onApplicationQuit;
+
+        void Update()
+        {
+            update?.Invoke();
+        }
+
+        private void LateUpdate()
+        {
+            lateUpdate?.Invoke();
+        }
+
+        private void OnApplicationQuit()
+        {
+            onApplicationQuit?.Invoke();
+        }
+    }
+}

+ 1 - 1
GameClient/Assets/Game/HotUpdate/ETView/HotfixView/Demo/Opera/OperaComponentSystem.cs.meta → GameClient/Assets/Game/Launcher/HotUpdateProxy/HotUpdateProxy.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 214657534f73b524da8b626ff4aa9795
+guid: ef0977672ac816346a41c51d6ba6aaad
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 2 - 1
GameClient/Assets/Game/Launcher/ILRuntime/ILRuntimeLauncher.cs

@@ -8,6 +8,7 @@ using GFGGame.Launcher;
 //using ILRuntime.Generated.CrossBinding;
 using System;
 using VEngine;
+using System.Linq;
 
 //下面这行为了取消使用WWW的警告,Unity2018以后推荐使用UnityWebRequest,处于兼容性考虑Demo依然使用WWW
 #pragma warning disable CS0618
@@ -156,7 +157,7 @@ namespace GFGGame
 
         void OnILHotFixLoaded()
         {
-
+            HotUpdateCodeLoader.Instance.allTypes = appdomain.LoadedTypes.Values.Select(x => x.ReflectionType).ToArray();
             //第一次方法调用
             appdomain.Invoke("GFGGame.HotUpdate.HotUpdateEntry", "Start", null, null);
         }

+ 4 - 44
GameClient/Assets/Game/Launcher/Version/VersionController.cs

@@ -3,6 +3,7 @@ using VEngine;
 using System.Collections;
 using UnityEngine;
 using System.Reflection;
+using System;
 
 namespace GFGGame
 {
@@ -10,6 +11,8 @@ namespace GFGGame
     {
         private UpdateVersions updateVersions;
 
+        
+
         public void Init()
         {
             StartCoroutine(InitVersion());
@@ -156,52 +159,9 @@ namespace GFGGame
             LauncherView.Instance.SetDesc($"正在启动游戏...");
             LauncherView.Instance.SetProgress(100, () =>
             {
-                StartCoroutine(StartLoadAssemblyHotfix());
+                HotUpdateCodeLoader.Instance.StartLoad();
             });
         }
 
-        IEnumerator StartLoadAssemblyHotfix()
-        {
-            Debug.LogFormat("ILRuntimeLauncher StartLoadAssemblyHotfix");
-            yield return new WaitForSeconds(0.1f);
-            var dllPath = "Assets/Res/Code/Game.HotUpdate.dll.bytes";
-            var asset = GFGAsset.Load<TextAsset>(dllPath);
-            byte[] assBytes = asset.bytes;
-            //Debug.LogFormat("assBytes != null {0}", assBytes != null);
-            //Debug.LogFormat("assBytes.Length {0}", assBytes.Length);
-            //yield return new WaitForSeconds(0.1f);
-            var pdbPath = "Assets/Res/Code/Game.HotUpdate.pdb.bytes";
-            asset = GFGAsset.Load<TextAsset>(pdbPath);
-            byte[] pdbBytes = asset.bytes;
-            //Debug.LogFormat("pdbBytes != null {0}", pdbBytes != null);
-            //Debug.LogFormat("pdbBytes.Length {0}", pdbBytes.Length);
-            if(LauncherConfig.ILRuntimeMode)
-            {
-                Debug.LogFormat("Assembly Mode ILRuntime");
-                ILRuntimeLauncher.Instance.LoadAssembly(assBytes, pdbBytes);
-            }
-            else
-            {
-                Debug.LogFormat("Assembly Mode Jit");
-                StartCoroutine(LoadAssemblyJustInTime(assBytes, pdbBytes));
-            }
-            GFGAsset.Release(dllPath);
-            GFGAsset.Release(pdbPath);
-        }
-
-        IEnumerator LoadAssemblyJustInTime(byte[] assBytes, byte[] pdbBytes)
-        {
-            //yield return new WaitForSeconds(0.1f);
-            //mono模式
-            var assembly = Assembly.Load(assBytes, pdbBytes);
-            //Debug.LogFormat("assembly != null {0}", assembly != null);
-            //yield return new WaitForSeconds(0.1f);
-            System.Type type = assembly.GetType("GFGGame.HotUpdate.HotUpdateEntry");
-            //Debug.LogFormat("type != null {0}", type != null);
-            //yield return new WaitForSeconds(0.1f);
-            type.GetMethod("Start").Invoke(type, null);
-            yield break;
-        }
-
     }
 }