Browse Source

限时累充和章节剧情UI调整

zhangyuqian 1 year ago
parent
commit
3482581068

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/DailyWelfareView.cs

@@ -95,7 +95,7 @@ namespace GFGGame
         }
         private void UpdateTime(object param)
         {
-            if (ActivityDataManager.Instance.actLimitChargeId > 0)
+            if (ActivityDataManager.Instance.actLimitChargeId > 0 || _limitChargeInfo.Count > 0)
             {
                 for (int i = 0; i < _limitChargeInfo.Count; i++)
                 {

+ 9 - 13
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs

@@ -76,6 +76,7 @@ namespace GFGGame
 
             Timers.inst.Remove(CheckGuide);
             Timers.inst.Remove(OnTimerUpdate);
+            Timers.inst.Remove(DoSpecialEffect);
         }
 
         private void OnClickBtnBack()
@@ -107,7 +108,7 @@ namespace GFGGame
             StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterID);
             //这里变成-1,是因为调整了item,最左右两边现在有item但是是透明没数据的
             int index = chapterCfg.order - 1;
-            index = Mathf.Clamp(index, 0, _ui.m_listChapter.numItems - 2);
+            //index = Mathf.Clamp(index, 0, _ui.m_listChapter.numItems - 2);
             int firstChildIndex = _ui.m_listChapter.GetFirstChildInView();
             if (firstChildIndex != index)
             {
@@ -288,6 +289,7 @@ namespace GFGGame
             }
             _timeCount = 0;
             Timers.inst.Add(0.1f, _ui.m_listChapter.numChildren , OnTimerUpdate, 1);
+            DoSpecialEffect();
         }
         private void CheckGuide(object param)
         {
@@ -323,18 +325,18 @@ namespace GFGGame
             GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.STUDIO_FILING, 1, "点击返回主界面。");
         }
 
-        private void DoSpecialEffect()
+        private void DoSpecialEffect(object parm = null)
         {
-            float listCenter = _ui.m_listChapter.scrollPane.posX + _ui.m_listChapter.viewWidth / 2;
+            //scrollPane.scrollingPosX这个实时变化,。scrollPane.posX这个使用ScrlootoVIew直接取终值
+            float listCenter = _ui.m_listChapter.scrollPane.scrollingPosX + _ui.m_listChapter.viewWidth / 2;
             float listLeft = _ui.m_listChapter.scrollPane.posX + _ui.m_listChapter.viewWidth / 2; ;
-            //list组件的x值,加上list组件自身宽度的一半,设置为对标的中心x值
             for (int i = 0; i < _ui.m_listChapter.numChildren; i++)
             {
                 GObject item = _ui.m_listChapter.GetChildAt(i);
                 float itemCenter = item.x + item.width / 2;//循环列表内元素的中心x值
                 float itemWidth = item.width;//列表元素的宽度
                 float distance = Mathf.Abs(listCenter - itemCenter);
-                if (distance < item.width)
+               // if (distance < item.width)
                 {
                     float distanceRange = 1 + (1 - distance / itemWidth) * 0.3f;//使放大动画有渐进效果
                     item.SetScale(distanceRange, distanceRange);//设置放大比例
@@ -350,16 +352,10 @@ namespace GFGGame
                         listItem.m_content.m_compPic.m_pic.color = new Color(0.4f, 0.4f, 0.4f, 1.000f);
                     }
                 }
-                else
-                {
-                    //设置颜色变化
-                    UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(_ui.m_listChapter.GetChildAt(i));
-                    listItem.m_content.m_compPic.m_pic.color = new Color(0.4f, 0.4f, 0.4f, 1.000f);
-                    item.SetScale(1.0f, 1.0f);
-                }
                 float distanceX = ((1 - (listCenter - itemCenter)) / itemWidth) * 0.05f;//使y轴移动有渐进效果
                 item.y = -_ui.m_listChapter.height * distanceX;
             }
         }
-    }
+        
+      }
 }

BIN
GameClient/Assets/ResIn/UI/DailyWelfare/DailyWelfare_fui.bytes


BIN
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes