From 0dce8be3e4fed7cb8c74cfc5775055aba349eec4 Mon Sep 17 00:00:00 2001 From: tanghai Date: Tue, 4 Aug 2020 23:50:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=87=BA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Unity/Assets/HotfixView/AppStart_Init.cs | 10 +++++++-- .../AfterCreateZoneScene_AddComponent.cs | 1 + .../Scene/SceneFactory.cs | 5 +++-- .../Scene/SceneFactory.cs.meta | 2 +- .../AfterCreateZoneScene_CreateLoginUI.cs | 12 ---------- .../AppStartInitFinish_CreateLoginUI.cs | 12 ++++++++++ ... AppStartInitFinish_CreateLoginUI.cs.meta} | 2 +- .../UI/UILogin/UILoginComponentSystem.cs | 2 +- Unity/Assets/Model/EventType.cs | 5 +++++ .../Module/Resource/ResourcesComponent.cs | 10 +++++++++ Unity/Assets/Model/Unit/TurnComponent.cs | 2 +- Unity/Assets/Model/Unit/Unit.cs | 6 ++++- Unity/Assets/ModelView/Module/UI/UI.cs | 22 +++++++++---------- .../ModelView/Unit/AnimatorComponent.cs | 2 +- Unity/Unity.Hotfix.csproj | 1 - Unity/Unity.HotfixView.csproj | 3 ++- 16 files changed, 62 insertions(+), 35 deletions(-) rename Unity/Assets/{Hotfix => HotfixView}/Scene/SceneFactory.cs (86%) rename Unity/Assets/{Hotfix => HotfixView}/Scene/SceneFactory.cs.meta (83%) delete mode 100644 Unity/Assets/HotfixView/UI/UILogin/AfterCreateZoneScene_CreateLoginUI.cs create mode 100644 Unity/Assets/HotfixView/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs rename Unity/Assets/HotfixView/UI/UILogin/{AfterCreateZoneScene_CreateLoginUI.cs.meta => AppStartInitFinish_CreateLoginUI.cs.meta} (83%) diff --git a/Unity/Assets/HotfixView/AppStart_Init.cs b/Unity/Assets/HotfixView/AppStart_Init.cs index 3919f318..3ffdf62d 100644 --- a/Unity/Assets/HotfixView/AppStart_Init.cs +++ b/Unity/Assets/HotfixView/AppStart_Init.cs @@ -11,14 +11,20 @@ namespace ET //await BundleHelper.DownloadBundle("1111"); // 加载配置 - Game.Scene.AddComponent().LoadBundle("config.unity3d"); + Game.Scene.AddComponent(); + + ResourcesComponent.Instance.LoadBundle("config.unity3d"); Game.Scene.AddComponent(); - Game.Scene.GetComponent().UnloadBundle("config.unity3d"); + ResourcesComponent.Instance.UnloadBundle("config.unity3d"); + Game.Scene.AddComponent(); Game.Scene.AddComponent(); + Game.Scene.AddComponent(); Scene zoneScene = await SceneFactory.CreateZoneScene(1, 0, "Game"); + + await Game.EventSystem.Publish(new EventType.AppStartInitFinish() { ZoneScene = zoneScene }); } } } \ No newline at end of file diff --git a/Unity/Assets/HotfixView/Scene/AfterCreateZoneScene_AddComponent.cs b/Unity/Assets/HotfixView/Scene/AfterCreateZoneScene_AddComponent.cs index 772b4ba1..7dc6704e 100644 --- a/Unity/Assets/HotfixView/Scene/AfterCreateZoneScene_AddComponent.cs +++ b/Unity/Assets/HotfixView/Scene/AfterCreateZoneScene_AddComponent.cs @@ -6,6 +6,7 @@ namespace ET { Scene zoneScene = args.ZoneScene; zoneScene.AddComponent(); + zoneScene.AddComponent(); } } } \ No newline at end of file diff --git a/Unity/Assets/Hotfix/Scene/SceneFactory.cs b/Unity/Assets/HotfixView/Scene/SceneFactory.cs similarity index 86% rename from Unity/Assets/Hotfix/Scene/SceneFactory.cs rename to Unity/Assets/HotfixView/Scene/SceneFactory.cs index 8762c2db..1ef25a03 100644 --- a/Unity/Assets/Hotfix/Scene/SceneFactory.cs +++ b/Unity/Assets/HotfixView/Scene/SceneFactory.cs @@ -9,8 +9,9 @@ namespace ET zoneScene.AddComponent(); zoneScene.AddComponent(); zoneScene.AddComponent(); - - await Game.EventSystem.Publish(new EventType.AfterCreateZoneScene()); + + // UI层的初始化 + await Game.EventSystem.Publish(new EventType.AfterCreateZoneScene() {ZoneScene = zoneScene}); return zoneScene; } diff --git a/Unity/Assets/Hotfix/Scene/SceneFactory.cs.meta b/Unity/Assets/HotfixView/Scene/SceneFactory.cs.meta similarity index 83% rename from Unity/Assets/Hotfix/Scene/SceneFactory.cs.meta rename to Unity/Assets/HotfixView/Scene/SceneFactory.cs.meta index 987803b3..b0606ed4 100644 --- a/Unity/Assets/Hotfix/Scene/SceneFactory.cs.meta +++ b/Unity/Assets/HotfixView/Scene/SceneFactory.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7cbe6b8dba0d1462e8ef45f7674b9794 +guid: 6132d5efb1bae460db2ef73d954f24e0 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Unity/Assets/HotfixView/UI/UILogin/AfterCreateZoneScene_CreateLoginUI.cs b/Unity/Assets/HotfixView/UI/UILogin/AfterCreateZoneScene_CreateLoginUI.cs deleted file mode 100644 index e7081961..00000000 --- a/Unity/Assets/HotfixView/UI/UILogin/AfterCreateZoneScene_CreateLoginUI.cs +++ /dev/null @@ -1,12 +0,0 @@ - - -namespace ET -{ - public class AfterCreateZoneScene_RemoveLoginUI: AEvent - { - public override async ETTask Run(EventType.AfterCreateZoneScene args) - { - await UIHelper.Create(args.ZoneScene, UIType.UILogin); - } - } -} diff --git a/Unity/Assets/HotfixView/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs b/Unity/Assets/HotfixView/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs new file mode 100644 index 00000000..5abdb385 --- /dev/null +++ b/Unity/Assets/HotfixView/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs @@ -0,0 +1,12 @@ + + +namespace ET +{ + public class AppStartInitFinish_RemoveLoginUI: AEvent + { + public override async ETTask Run(EventType.AppStartInitFinish args) + { + await UIHelper.Create(args.ZoneScene, UIType.UILogin); + } + } +} diff --git a/Unity/Assets/HotfixView/UI/UILogin/AfterCreateZoneScene_CreateLoginUI.cs.meta b/Unity/Assets/HotfixView/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs.meta similarity index 83% rename from Unity/Assets/HotfixView/UI/UILogin/AfterCreateZoneScene_CreateLoginUI.cs.meta rename to Unity/Assets/HotfixView/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs.meta index 9e2a6446..488066f2 100644 --- a/Unity/Assets/HotfixView/UI/UILogin/AfterCreateZoneScene_CreateLoginUI.cs.meta +++ b/Unity/Assets/HotfixView/UI/UILogin/AppStartInitFinish_CreateLoginUI.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f86b269e7cff94f3cb2a36780d7a9f27 +guid: 8ca3bab3d15364846a895a2545184b52 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Unity/Assets/HotfixView/UI/UILogin/UILoginComponentSystem.cs b/Unity/Assets/HotfixView/UI/UILogin/UILoginComponentSystem.cs index c5242c19..ac463511 100644 --- a/Unity/Assets/HotfixView/UI/UILogin/UILoginComponentSystem.cs +++ b/Unity/Assets/HotfixView/UI/UILogin/UILoginComponentSystem.cs @@ -10,7 +10,7 @@ namespace ET { public override void Awake(UILoginComponent self) { - ReferenceCollector rc = self.GetParent().ViewGO.GetComponent(); + ReferenceCollector rc = self.GetParent().GameObject.GetComponent(); self.loginBtn = rc.Get("LoginBtn"); self.loginBtn.GetComponent