From 3bd7f56906e31e8fe0072108c9d4652707b51de8 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期二, 21 十月 2025 17:59:00 +0800
Subject: [PATCH] 125 战斗 战斗UI

---
 Main/Manager/StageManager.cs |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/Main/Manager/StageManager.cs b/Main/Manager/StageManager.cs
index c1890ff..8bac2ec 100644
--- a/Main/Manager/StageManager.cs
+++ b/Main/Manager/StageManager.cs
@@ -18,31 +18,55 @@
     public Action BeforeLoadingGameScene;
 
     // public Action OnSwitchAccount;
+    private LaunchWinData launchWinData = null;
 
     public void Init()
     {
-
+        UIManager.Instance.OnCloseWindow += OnCloseWindow;
     }
 
     public void Release()
     {
         AfterLoadingGameScene = null;
         BeforeLoadingGameScene = null;
+        UIManager.Instance.OnCloseWindow -= OnCloseWindow;
     }
 
     public async UniTaskVoid ToLoginScene()
     {
         UIManager.Instance.DestroyAllUI();
 
+        if (AssetSource.isUseAssetBundle)
+        {
+            AssetBundleUtility.Instance.Sync_LoadAll("maps/Login");
+        }
+
         AsyncOperation asyncOperation = SceneManager.LoadSceneAsync("Login");
 
-        await OnLoading(asyncOperation, ConfigManager.Instance.GetLoadingProgress);
+        await OnLoading(asyncOperation, ConfigManager.Instance.GetLoadingProgress, Main.InitManagers);
 
         Main.OnSwitchToLoginScene();
 
         currentStage = StageName.Login;
         UIManager.Instance.OpenWindow<LaunchBackGroundWin>();
         UIManager.Instance.OpenWindow<LoginWin>();
+    }
+
+    // 杩斿洖鐧诲綍鐣岄潰 濡傛柇绾�
+    public void ReturnToLoginScene()
+    {
+        UIManager.Instance.DestroyAllUI();
+
+        SceneManager.LoadSceneAsync("Login");
+
+        currentStage = StageName.Login;
+        UIManager.Instance.OpenWindow<LaunchBackGroundWin>();
+        UIManager.Instance.OpenWindow<LoginWin>();
+
+        if (ServerForceExitHintWin.reason != 0)
+        {
+            UIManager.Instance.OpenWindow<ServerForceExitHintWin>();
+        }
     }
 
     protected float GetManagerRequestDataProgress()
@@ -74,13 +98,19 @@
         BeforeLoadingGameScene?.Invoke();
 
         // ResManager.Instance.PrewarmResources();
+        if (AssetSource.isUseAssetBundle)
+        {
+            AssetBundleUtility.Instance.Sync_LoadAll("maps/Game");
+        }
 
         AsyncOperation asyncOperation = SceneManager.LoadSceneAsync("Game");
 
-        await OnLoading(asyncOperation, GetManagerRequestDataProgress);
+        await OnLoading(asyncOperation, () => (DTC0403_tagPlayerLoginLoadOK.finishedLogin ? .5f : 0f) + GetManagerRequestDataProgress() * .5f);
 
         //  鍔犺浇鍒濆鍖栨暟鎹畬鎴�
         currentStage = StageName.Game;
+
+        Main.OnEnterGameScene();
 
         AfterLoadingGameScene?.Invoke();
 
@@ -92,6 +122,18 @@
         asyncOperation.allowSceneActivation = false;
 
         LoadingWin loadingWin = UIManager.Instance.OpenWindow<LoadingWin>();
+
+        LaunchWin launchWin = UIManager.Instance.GetUI<LaunchWin>();
+        if (null != launchWin && launchWin.IsActive() && launchWinData == null)
+        {
+            launchWinData = launchWin.GetData();
+        }
+
+        if (null != launchWinData)
+        {
+            loadingWin.SetData(launchWinData);
+            launchWinData = null;
+        }
 
         while (!asyncOperation.isDone)
         {
@@ -127,4 +169,12 @@
 
         loadingWin.CloseWindow();
     }
+
+    private void OnCloseWindow(UIBase closeUI)
+    {
+        if (closeUI is LaunchWin)
+        {
+            launchWinData = (closeUI as LaunchWin).GetData();
+        }
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0