Browse Source

修改摘星界面中,滑动结束的逻辑

leiyasi 1 năm trước cách đây
mục cha
commit
9e9d2fe608

+ 24 - 11
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -13,7 +13,7 @@ namespace GFGGame
     {
     {
         private UI_LuckyBoxUI _ui;
         private UI_LuckyBoxUI _ui;
         private ValueBarController _valueBarController;
         private ValueBarController _valueBarController;
-        private Dictionary<int, LuckyBoxController> _lcukyBoxCtrl = new Dictionary<int, LuckyBoxController>();
+        private Dictionary<int, LuckyBoxController> _luckyBoxCtrl = new Dictionary<int, LuckyBoxController>();
 
 
         private EffectUI _effectUI1;
         private EffectUI _effectUI1;
         private EffectUI _effectUI2;
         private EffectUI _effectUI2;
@@ -36,11 +36,11 @@ namespace GFGGame
                 _valueBarController.Dispose();
                 _valueBarController.Dispose();
                 _valueBarController = null;
                 _valueBarController = null;
             }
             }
-            foreach (int key in _lcukyBoxCtrl.Keys)
+            foreach (int key in _luckyBoxCtrl.Keys)
             {
             {
-                _lcukyBoxCtrl[key].Dispose();
+                _luckyBoxCtrl[key].Dispose();
             }
             }
-            _lcukyBoxCtrl.Clear();
+            _luckyBoxCtrl.Clear();
             if (_dressUpObjUIXiHe != null)
             if (_dressUpObjUIXiHe != null)
             {
             {
                 _dressUpObjUIXiHe.Dispose();
                 _dressUpObjUIXiHe.Dispose();
@@ -81,7 +81,7 @@ namespace GFGGame
             // _ui.m_listBg.SetVirtual();
             // _ui.m_listBg.SetVirtual();
             _ui.m_listBg.itemRenderer = RenderListBgItem;
             _ui.m_listBg.itemRenderer = RenderListBgItem;
             // _ui.m_listBg.itemProvider = GetListItemResource;
             // _ui.m_listBg.itemProvider = GetListItemResource;
-            _ui.m_listBg.scrollPane.onScrollEnd.Add(OnListBgScroll);
+            _ui.m_listBg.scrollPane.onScrollEnd.Add(OnScrollEnd);
 
 
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
         }
         }
@@ -212,9 +212,20 @@ namespace GFGGame
                 GetWishingPoolInfo(_activityId);
                 GetWishingPoolInfo(_activityId);
         }
         }
 
 
+        private void OnScrollEnd()
+        {
+            // 未更新滚动位置的时候,不更新,防止不停的播放渐入动画
+            int index = _ui.m_listBg.GetFirstChildInView();
+            if(index == _curIndex)
+            {
+                return;
+            }
+            OnListBgScroll();
+        }
+
         private void OnListBgScroll()
         private void OnListBgScroll()
         {
         {
-            if (_lcukyBoxCtrl.ContainsKey(LuckyBoxDataManager.Instance.currentBoxId)) _lcukyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnHide();
+            if (_luckyBoxCtrl.ContainsKey(LuckyBoxDataManager.Instance.currentBoxId)) _luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnHide();
             _curIndex = _ui.m_listBg.GetFirstChildInView();
             _curIndex = _ui.m_listBg.GetFirstChildInView();
             LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
             LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
             if (LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3)
             if (LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3)
@@ -226,6 +237,8 @@ namespace GFGGame
                 _valueBarController.Controller(4);
                 _valueBarController.Controller(4);
             }
             }
             _valueBarController.UpdateCJ();
             _valueBarController.UpdateCJ();
+
+
             UpdateListItem();
             UpdateListItem();
             _ui.m_btnLeft.grayed = _curIndex <= 0;
             _ui.m_btnLeft.grayed = _curIndex <= 0;
             _ui.m_btnRight.grayed = _curIndex >= _ui.m_listBg.numItems - 1;
             _ui.m_btnRight.grayed = _curIndex >= _ui.m_listBg.numItems - 1;
@@ -251,12 +264,12 @@ namespace GFGGame
             else 
             else 
                 comBox.m_showActivityType.selectedIndex = 0;
                 comBox.m_showActivityType.selectedIndex = 0;
 
 
-            if (!_lcukyBoxCtrl.ContainsKey(boxId))
+            if (!_luckyBoxCtrl.ContainsKey(boxId))
             {
             {
-                _lcukyBoxCtrl.Add(boxId, new LuckyBoxController(comBox.m_comModel.target));
+                _luckyBoxCtrl.Add(boxId, new LuckyBoxController(comBox.m_comModel.target));
             }
             }
 
 
-            _lcukyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnShown(LuckyBoxDataManager.Instance.currentBoxId);
+            _luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnShown(LuckyBoxDataManager.Instance.currentBoxId);
 
 
             comBox.m_comLuckBoxBtn.m_imgSpecial.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
             comBox.m_comLuckBoxBtn.m_imgSpecial.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
             //GGraph holder = comBox.m_comLuckBoxBtn.m_btnBuyTen.GetChild("holder").asGraph;
             //GGraph holder = comBox.m_comLuckBoxBtn.m_btnBuyTen.GetChild("holder").asGraph;
@@ -563,9 +576,9 @@ namespace GFGGame
             _effectUI2 = null;
             _effectUI2 = null;
 
 
             _valueBarController.OnHide();
             _valueBarController.OnHide();
-            foreach (int key in _lcukyBoxCtrl.Keys)
+            foreach (int key in _luckyBoxCtrl.Keys)
             {
             {
-                _lcukyBoxCtrl[key].OnHide();
+                _luckyBoxCtrl[key].OnHide();
             }
             }
 
 
             Timers.inst.Remove(OnTimerUpdate);
             Timers.inst.Remove(OnTimerUpdate);

BIN
GameClient/Assets/ResIn/UI/Store/Store_fui.bytes