Bladeren bron

好友返回登录后红点异常

zhaoyang 2 jaren geleden
bovenliggende
commit
399374a14a

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -163,6 +163,7 @@ namespace GFGGame
             GuideDataManager.Clear();
             GetSuitItemController.Clear();
             FriendDataManager.Instance.Clear();
+            RedDotController.Instance.Clear();
             GameGlobal.zoneScene.GetComponent<SessionComponent>()?.Disconnect();
             GameGlobal.zoneScene.GetComponent<ServerInfosComponent>()?.ServerInfoList?.Clear();
             GameGlobal.zoneScene.GetComponent<AccountInfoComponent>()?.Clear();

+ 8 - 0
GameClient/Assets/Game/HotUpdate/Controller/RedDotController.cs

@@ -8,6 +8,14 @@ namespace GFGGame
     {
         private List<GComponent> comRedDotPool = new List<GComponent>();
 
+        public void Clear()
+        {
+            for (int i = 0; i < comRedDotPool.Count; i++)
+            {
+                comRedDotPool[i].Dispose();
+            }
+            comRedDotPool.Clear();
+        }
         public void SetComRedDot(GComponent parentCom, bool isRed, string res = "", int left = 0, int top = 0)
         {
             GComponent comRedDot;

+ 5 - 4
GameClient/Assets/Game/HotUpdate/Views/DailyLogin/DailyLoginView.cs

@@ -65,6 +65,7 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
+            _ui.m_list.numItems = 0;
             ViewManager.SetMaskAlpha(0.6f);
         }
         private void ListItemRender(int index, GObject obj)
@@ -78,10 +79,10 @@ namespace GFGGame
             item.m_txtNum.text = "x" + NumberUtil.ChangeNumberUnit(cfg.rewardsArr[0][1], 10000);
             int dailyLoginId = ActivityDataManager.Instance.dailyLoginId;
             item.m_imgGot.visible = cfg.id < dailyLoginId || cfg.id == dailyLoginId && ActivityDataManager.Instance.dailyLoginBonusStatus == ConstBonusStatus.GOT;
-            if (cfg.id == dailyLoginId)
-            {
-                RedDotController.Instance.SetComRedDot(item.target, ActivityDataManager.Instance.dailyLoginBonusStatus == ConstBonusStatus.CAN_GET);
-            }
+            // if (cfg.id == dailyLoginId)
+            // {
+            RedDotController.Instance.SetComRedDot(item.target, cfg.id == dailyLoginId && ActivityDataManager.Instance.dailyLoginBonusStatus == ConstBonusStatus.CAN_GET);
+            // }
             if (item.target.data == null)
             {
                 item.target.onClick.Add(OnListItemClick);