Просмотр исходного кода

摘星修改引导读取对象方式

huangxiaoyue 1 год назад
Родитель
Сommit
4e1d21210e
1 измененных файлов с 13 добавлено и 8 удалено
  1. 13 8
      GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

+ 13 - 8
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -334,8 +334,9 @@ namespace GFGGame
 
         private void UpdateBtnReward()
         {
-            if (_curIndex == 1) { 
-                GObject obj = _ui.m_listBg.GetChildAt(_curIndex);
+            if (_curIndex == 1) {
+                int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
+                GObject obj = _listActivityBtnObj[boxId];
                 UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
                 RedDotController.Instance.SetComRedDot(comBox.m_btnReward.target, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy), "", -21, 18);
 
@@ -440,7 +441,8 @@ namespace GFGGame
             long curTime = TimeHelper.ServerNow();
             TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
 
-            GObject item = _ui.m_listBg.GetChildAt(0);
+            int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
+            GObject item = _listActivityBtnObj[boxId];
             if (item == null) return;
             GObject textField = item.asCom.GetChild("txtTime");
             if (textField == null) return;
@@ -452,7 +454,8 @@ namespace GFGGame
 
         private void UpdateImitateTime(object param = null)
         {
-            GObject item = _ui.m_listBg.GetChildAt(1);
+            int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[1];
+            GObject item = _listActivityBtnObj[boxId];
             GObject textField = item.asCom.GetChild("txtHasTime");
             if (textField == null) return;
             long curTime = TimeHelper.ServerNow();
@@ -467,7 +470,8 @@ namespace GFGGame
 
         private void UpdateTime(object param = null)
         {
-            GObject item = _ui.m_listBg.GetChildAt(1);
+            int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[1];
+            GObject item = _listActivityBtnObj[boxId];
             if (item == null) return;
             GObject textField = item.asCom.GetChild("txtTsyTime");
             if (textField == null) return;
@@ -642,10 +646,11 @@ namespace GFGGame
         protected override void UpdateToCheckGuide(object param)
         {
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
-            GObject gObject = _ui.m_listBg.GetChildAt(_curIndex);
+            if (_curIndex > 0) return;
+            int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
+            GObject gObject = _listActivityBtnObj[boxId];
             if (gObject == null) return; 
-           GButton btnBuyTen = gObject.asCom.GetChild("comLuckBoxBtn").asCom.GetChild("btnBuyTen").asButton;
-
+            GButton btnBuyTen = gObject.asCom.GetChild("comLuckBoxBtn").asCom.GetChild("btnBuyTen").asButton;
             GuideController.TryGuide(null, ConstGuideId.LUCKY_BOX, 1, "“摘星”里可以通过星辰的力量获得服饰。", -1, true, _ui.target.height - 600);
             GuideController.TryGuide(btnBuyTen, ConstGuideId.LUCKY_BOX, 2, "点击摘取十次。");
             GuideController.TryCompleteGuide( ConstGuideId.LUCKY_BOX, 2);