Selaa lähdekoodia

抽奖动画等待,抽奖连续抽防止报错,商城购买防止报错

huangxiaoyue 1 vuosi sitten
vanhempi
commit
3ea141fa57

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -178,6 +178,9 @@ namespace GFGGame
         //摘星抽奖活动奖励
         public const string LUCKY_BOX_ACTIVITY_REWARD = "LUCKY_BOX_ACTIVITY_REWARD";
 
+        //摘星抽奖等待动画加载
+        public const string LUCKY_BOX_ANIMATION_WAIT = "LUCKY_BOX_ANIMATION_WAIT";
+
         // 服装散件图鉴配置加载完成
         public const string DRESS_PART_LOAD_FINISHED = "DRESS_PART_LOAD_FINISHED";
 

+ 3 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Store/UI_ListShopItem.cs

@@ -10,9 +10,9 @@ namespace UI.Store
         public Controller m_c1;
         public Controller m_c2;
         public GImage m_imgDouble;
+        public GTextField m_txtDesc;
         public GGroup m_grpDiscount;
         public GGraph m_holderfEff;
-        public GTextField m_txtDesc;
         public GLoader m_icon;
         public GTextField m_txtName;
         public GTextField m_txtEndTime;
@@ -69,9 +69,9 @@ namespace UI.Store
             m_c1 = comp.GetController("c1");
             m_c2 = comp.GetController("c2");
             m_imgDouble = (GImage)comp.GetChild("imgDouble");
+            m_txtDesc = (GTextField)comp.GetChild("txtDesc");
             m_grpDiscount = (GGroup)comp.GetChild("grpDiscount");
             m_holderfEff = (GGraph)comp.GetChild("holderfEff");
-            m_txtDesc = (GTextField)comp.GetChild("txtDesc");
             m_icon = (GLoader)comp.GetChild("icon");
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_txtEndTime = (GTextField)comp.GetChild("txtEndTime");
@@ -84,9 +84,9 @@ namespace UI.Store
             m_c1 = null;
             m_c2 = null;
             m_imgDouble = null;
+            m_txtDesc = null;
             m_grpDiscount = null;
             m_holderfEff = null;
-            m_txtDesc = null;
             m_icon = null;
             m_txtName = null;
             m_txtEndTime = null;

+ 6 - 1
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs

@@ -114,6 +114,9 @@ namespace GFGGame
         }
         private void UpdateCurrency()
         {
+            if (_valueBar == null || _valueBar.m_btnGold == null || _valueBar.m_btnDiamondPurple == null || _valueBar.m_btnDiamondRed == null)
+                return;
+
             _valueBar.m_btnGold.target.text = "" + RoleDataManager.gold;
             _valueBar.m_btnDiamondPurple.target.text = "" + RoleDataManager.diaP;
             _valueBar.m_btnDiamondRed.target.text = "" + RoleDataManager.diaR;
@@ -140,7 +143,9 @@ namespace GFGGame
             LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId);
             if (luckyBoxCfg == null) return;
             _valueBar.m_btnCJ.target.text = "" + ItemDataManager.GetItemNum(luckyBoxCfg.costID);
-            _valueBar.m_btnCJ.target.icon = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg.costID).res);
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(luckyBoxCfg.costID);
+            if (itemCfg == null) return;
+            _valueBar.m_btnCJ.target.icon = ResPathUtil.GetCommonGameResPath(itemCfg.res);
             _valueBar.m_btnCJ.target.data = luckyBoxCfg.costID;
         }
 

+ 6 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/GetSuitItemVIew.cs

@@ -41,12 +41,17 @@ namespace GFGGame
             this.viewCom = _ui.target;
             isfullScreen = true;
 
-            _dressUpObjUI = new DressUpObjUI("SceneDressUp");
+            _dressUpObjUI = new DressUpObjUI("SceneDressUp",onShowAction);
             _ui.m_bg.onClick.Add(OnClickBg);
 
             _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderEffect, "ui_ck", "ui_ck_tz");
         }
 
+        void onShowAction()
+        {
+            EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_ANIMATION_WAIT);
+        }
+
         protected override void OnShown()
         {
             base.OnShown();

+ 12 - 1
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxBonusShowView.cs

@@ -22,6 +22,7 @@ namespace GFGGame
         private int _countShow = 0;   //第几次展示
         private int _countNewRecord = 0;  //展示步骤
         private bool _handClick = false;   //手动点击开启
+        private bool _AnimationWait = true;   //抽卡动画等待加载完毕
 
         private EffectUI _effectUI1;
         private EffectUI _effectUI2;
@@ -95,12 +96,14 @@ namespace GFGGame
         {
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_REWARD_SHOW, ReferNextShow);
+            EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_ANIMATION_WAIT, SetAnimationWait);
         }
 
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_REWARD_SHOW, ReferNextShow);
+            EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_ANIMATION_WAIT, SetAnimationWait);
         }
 
         protected void ReferNextShow()
@@ -346,6 +349,8 @@ namespace GFGGame
         private void ShowTurnItem(int index)
         {
             UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
+            if (!_AnimationWait)
+                return;
 
             if (item.m_comIcon.m_imgNew.visible)
             {
@@ -360,13 +365,14 @@ namespace GFGGame
                         _rewardItemList.Add(_rewardList[index]);
                         ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
                     }
-                    else
+                    else 
                     {
                         ViewManager.Hide<LuckyBoxNewDressView>();
                         ViewManager.Hide<LuckyBoxNewCardView>();
                         GetSuitItemController.TryShow(_itemIdList[index]);
                         _recordTurnIndex.Add(index);
                         _countShow = 0;
+                        _AnimationWait = false;
 
                         if (_handClick)
                         {
@@ -418,5 +424,10 @@ namespace GFGGame
             ViewManager.Hide<LuckyBoxNewDressView>();
             ViewManager.Hide<LuckyBoxNewCardView>();
         }
+
+        private void SetAnimationWait()
+        {
+            _AnimationWait = true;
+        }
     }
 }