zhaoyang 2 년 전
부모
커밋
e5470a4ddd
2개의 변경된 파일18개의 추가작업 그리고 16개의 파일을 삭제
  1. 14 0
      GameClient/Assets/Game/HotUpdate/ServerProxy/LuckyBoxSProxy.cs
  2. 4 16
      GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

+ 14 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/LuckyBoxSProxy.cs

@@ -22,5 +22,19 @@ namespace GFGGame
             }
             return false;
         }
+        //请求轮换抽奖活动信息
+        public static async ETTask<int> ReqGetLuckyBoxRotatingInfo()
+        {
+            S2C_GetLuckyBoxRotatingInfo response = null;
+            response = (S2C_GetLuckyBoxRotatingInfo)await MessageHelper.SendToServer(new C2S_GetLuckyBoxRotatingInfo() { });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    return response.RotatingId;
+                }
+            }
+            return 0;
+        }
     }
 }

+ 4 - 16
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -96,7 +96,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, OnListBgScroll);
             EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, OnListBgScroll);
         }
-        protected override void OnShown()
+        protected override async void OnShown()
         {
             base.OnShown();
 
@@ -116,7 +116,9 @@ namespace GFGGame
             if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0) boxId = LuckyBoxDataManager.BOX_ID_2;
             LuckyBoxDataManager.Instance.currentBoxId = boxId;
 
-            isActiveBoxOpen = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.BOX_ID_1) >= 0;
+            int result = await LuckyBoxSProxy.ReqGetLuckyBoxRotatingInfo();
+
+            isActiveBoxOpen = result > 0;
             if (isActiveBoxOpen)
             {
                 Timers.inst.Add(1, 0, CheckTime);
@@ -216,12 +218,6 @@ namespace GFGGame
             }
         }
 
-        // private void UpdateTime(object param)
-        // {
-        //     GTextField txtTime = _ui.m_listBg.GetChildAt(0).asCom.GetChild("txtTime").asTextField;
-        //     txtTime.text = TimeUtil.FormattingTime(LuckyBoxDataManager.Instance.startTime, LuckyBoxDataManager.Instance.startTime);
-        // }
-
         private void UpdateBg(object param)
         {
             string[] resArr = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId).resArr;
@@ -262,14 +258,6 @@ namespace GFGGame
             _ui.m_btnLeft.grayed = _curIndex <= 0;
             _ui.m_btnRight.grayed = _curIndex >= _ui.m_listBg.numItems - 1;
 
-            // if (LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1)
-            // {
-            //     Timers.inst.Add(1, 0, CheckTime);
-            // }
-            // else
-            // {
-            //     Timers.inst.Remove(CheckTime);
-            // }
         }
 
         private void CheckTime(object param = null)