Sfoglia il codice sorgente

限时累充红点修改

zhangyuqian 1 anno fa
parent
commit
daae700357

+ 25 - 25
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/NewLimitChargeView.cs

@@ -264,49 +264,49 @@ namespace GFGGame
         {
             int indexPrior = Math.Max(0, _curSelectIndex - 1);
             int indexNext = Math.Min(_rechargeCfgs.Count - 1, _curSelectIndex + 1);
-            SetRedDot(indexPrior);
-            SetRedDot(indexNext);
+            TraverseList(indexPrior);
+            TraverseList(indexNext);
         }
 
-        private void SetRedDot(int index)
+        private void TraverseList(int index)
         {
-            long limitChargeExp = _activityInfo.CountValue;
-            if (limitChargeExp >= _rechargeCfgs[index].value)
+            if (index < _curSelectIndex)
             {
-                if (_activityInfo.GetRewards.IndexOf(_rechargeCfgs[index].id) >= 0)
+                for (int i = index; i >= 0; i--)
                 {
-                    if (index < _curSelectIndex)
+                    if(SetRedDot(i))
                     {
-                        RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, false);
-                    }
-                    else
-                    {
-                        RedDotController.Instance.SetComRedDot(_ui.m_btnRight, false);
+                        RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, true);
+                        break;
                     }
+                    RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, false);
                 }
-                else
+            }
+            else
+            {
+                for (int i = index; i < _rechargeCfgs.Count; i++)
                 {
-                    if (index < _curSelectIndex)
-                    {
-                        RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, true);
-                    }
-                    else
+                    if (SetRedDot(i))
                     {
                         RedDotController.Instance.SetComRedDot(_ui.m_btnRight, true);
+                        break;
                     }
+                    RedDotController.Instance.SetComRedDot(_ui.m_btnRight, false);
                 }
             }
-            else
+        }
+
+        private bool SetRedDot(int index)
+        {
+            long limitChargeExp = _activityInfo.CountValue;
+            if (limitChargeExp >= _rechargeCfgs[index].value)
             {
-                if (index < _curSelectIndex)
-                {
-                    RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, false);
-                }
-                else
+                if (_activityInfo.GetRewards.IndexOf(_rechargeCfgs[index].id) < 0)
                 {
-                    RedDotController.Instance.SetComRedDot(_ui.m_btnRight, false);
+                    return true;
                 }
             }
+            return false;
         }
         private void OnBtnChargeClick()
         {