From 4fde46699701b1a8b74b4dab516624852b24a86d Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 23 六月 2025 14:24:50 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/Main/MainWin.cs |   81 +++++++++++-----------------------------
 1 files changed, 23 insertions(+), 58 deletions(-)

diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs
index 76a04cc..0db0f0f 100644
--- a/Main/System/Main/MainWin.cs
+++ b/Main/System/Main/MainWin.cs
@@ -4,16 +4,13 @@
 using UnityEngine.UI;
 
 /// <summary>
-/// 娓告垙涓荤晫闈�
+/// 娓告垙涓荤晫闈㈠簳閮ㄥ姛鑳芥寜閽�
 /// </summary>
 public class MainWin : UIBase
 {
-    public GameObject windowBackground;
-
     // 搴曢儴鎸夐挳缁�
     public Button[] bottomTabButtons;
 
-    private EffectPlayer[] bottomTabEffects;
     
     // 褰撳墠閫変腑鐨勫簳閮ㄦ爣绛剧储寮�
     private int currentTabIndex = 0;
@@ -48,55 +45,25 @@
 
     }
     
-    protected override void OnOpen()
+    public override void Refresh()
     {
-        base.OnOpen();
-        
+        UpdateCurrency();
+    }
+
+    protected override void OnPreOpen()
+    {
         // 榛樿閫変腑绗竴涓爣绛�
         SelectBottomTab(0);
 
         // 鍒锋柊UI
         Refresh();
     }
-    
-    public override void Refresh()
-    {
-        UpdatePlayerInfo();
-        UpdateCurrency();
-    }
 
-    protected override void OnPreOpen()
-    {
-        base.OnPreOpen();
-        bottomTabEffects = new EffectPlayer[bottomTabButtons.Length];
-        for (int i = 0; i < bottomTabButtons.Length; i++)
-        {
-            bottomTabEffects[i] = PlayUIEffect(1004, bottomTabButtons[i].transform, false);
-        }
-    }
-
-    protected override void OnPreClose()
-    {
-        base.OnPreClose();
-        foreach (var effectGO in bottomTabEffects)
-        {
-            DestroyImmediate(effectGO);
-        }
-        bottomTabEffects = null;
-    }
+    // protected override void OnPreClose()
+    // {
+    // }
     
-    /// <summary>
-    /// 鏇存柊鐜╁淇℃伅
-    /// </summary>
-    private void UpdatePlayerInfo()
-    {
-        // 浠庣帺瀹舵暟鎹腑鑾峰彇淇℃伅骞舵洿鏂癠I
-        // 渚嬪锛�
-        // playerNameText.text = PlayerData.Instance.Name;
-        // playerLevelText.text = "Lv." + PlayerData.Instance.Level;
-        // powerText.text = PlayerData.Instance.Power.ToString();
-        // expSlider.value = PlayerData.Instance.ExpRatio;
-    }
+
     
     /// <summary>
     /// 鏇存柊璐у竵淇℃伅
@@ -115,6 +82,13 @@
     /// </summary>
     private void OnBottomTabButtonClicked(int index)
     {
+        if (index == 0)
+        { 
+            if (currentSubUI != null && currentSubUI.name == "HomeWin")
+            {
+                //鎵撳紑涓荤晫闈㈢殑鎯呭喌涓嬪啀鐐瑰嚮鎸夐挳锛屾墽琛屾敾鍑婚�昏緫
+            }
+        }
         SelectBottomTab(index);
     }
     
@@ -150,12 +124,8 @@
         // 閬嶅巻鎵�鏈夋寜閽紝璁剧疆閫変腑鐘舵��
         for (int i = 0; i < bottomTabButtons.Length; i++)
         {
-            // 杩欓噷鍙互鏍规嵁鏄惁閫変腑璁剧疆鎸夐挳鐨勮瑙夋晥鏋�
-            // 渚嬪锛氭敼鍙樺浘鐗囥�侀鑹茬瓑
-            // bottomTabButtons[i].GetComponent<Image>().color = (i == currentTabIndex) ? Color.blue : Color.white;
 
-            // 鎴栬�呮縺娲�/绂佺敤閫変腑鍥炬爣
-            bottomTabButtons[i].image.color = (i == currentTabIndex) ?  Color.white : Color.gray;
+            // bottomTabButtons[i].image.color = (i == currentTabIndex) ?  Color.white : Color.gray;
         }
     }
     
@@ -179,34 +149,29 @@
     {
 
         Debug.Log("鎵撳紑瀛愮晫闈� : " + index);
-        // 涓诲煄 闃靛 鍚岀洘 绂忓埄 鍐掗櫓
-        windowBackground.SetActive(index != 4);
+        // 涓诲煄 鍐呮斂 姝﹀皢 鎸戞垬 鍏細
         //鏍规嵁绱㈠紩鎵撳紑涓嶅悓鐨勭晫闈�
          switch (index)
         {
             case 0:
-                // 渚嬪锛氭墦寮�涓婚〉鐣岄潰
-                // currentSubUI = UIManager.Instance.OpenUI<HomeUI>();
+                // 鎵撳紑涓婚〉鐣岄潰
+                currentSubUI = UIManager.Instance.OpenWindow<HomeWin>();
                 Debug.Log("鎵撳紑涓诲煄鐣岄潰");
                 break;
             case 1:
-                // 渚嬪锛氭墦寮�瑙掕壊鐣岄潰
                 // currentSubUI = UIManager.Instance.OpenUI<CharacterUI>();
                 Debug.Log("鎵撳紑闃靛鐣岄潰");
                 break;
             case 2:
-                // 渚嬪锛氭墦寮�鑳屽寘鐣岄潰
                 // currentSubUI = UIManager.Instance.OpenUI<BagUI>();
                 Debug.Log("鎵撳紑鍚岀洘鐣岄潰");
                 break;
             case 3:
-                // 渚嬪锛氭墦寮�浠诲姟鐣岄潰
                 // currentSubUI = UIManager.Instance.OpenUI<QuestUI>();
                 Debug.Log("鎵撳紑绂忓埄鐣岄潰");
                 break;
             case 4:
-                // 渚嬪锛氭墦寮�璁剧疆鐣岄潰
-                currentSubUI = UIManager.Instance.OpenWindow<PlaceWin>();
+                //currentSubUI = UIManager.Instance.OpenWindow<PlaceWin>();
                 Debug.Log("鎵撳紑鍐掗櫓鐣岄潰");
                 break;
             default:

--
Gitblit v1.8.0