Przeglądaj źródła

摘星双指点击过快,用延迟响应触发处理

huangxiaoyue 1 rok temu
rodzic
commit
fbcf20161f

+ 9 - 8
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxBonusShowView.cs

@@ -22,6 +22,7 @@ namespace GFGGame
         private int _countShow = 0;   //第几次展示
         private bool _handClick = false;   //手动点击开启
         private bool _AnimationWait = true;   //抽卡动画等待加载完毕
+        bool _touchLoaBg = true;    //防止点击背景事件太快
 
         private EffectUI _effectUI1;
         private EffectUI _effectUI2;
@@ -283,8 +284,6 @@ namespace GFGGame
 
         private void HandClickItem(int index)
         {
-            ET.Log.Debug("打印测试======点击触发====翻牌开始动画=====");
-
             _ui.m_touchFlipOpen.touchable = true;
             _handClick = true;
             ClickItem(index);
@@ -321,17 +320,19 @@ namespace GFGGame
             }
         }
 
+        private void UpDataTimeTouchLoaBg(object param = null)
+        {
+            _touchLoaBg = true;
+        }
+
         private void OnClickLoaBg(EventContext context)
         {
-            ET.Log.Debug("打印测试======context.inputEvent.clickCount==========" + context.inputEvent.clickCount);
-            ET.Log.Debug("打印测试======context.inputEvent.isDoubleClick==========" + context.inputEvent.isDoubleClick);
-            ET.Log.Debug("打印测试======context.inputEvent.button==========" + context.inputEvent.button);
-            ET.Log.Debug("打印测试======Stage.inst.touchCount=========" + Stage.inst.touchCount);
-            if (Stage.inst.touchCount != 1)
+            if (!_touchLoaBg)
             {
                 return;
             }
-            ET.Log.Debug("打印测试======点击触发=========");
+            _touchLoaBg = false;
+            Timers.inst.Add(0.01f, 1, UpDataTimeTouchLoaBg);
 
             if (_recordOpenIndex.Count >= _rewardList.Count)
             {