Browse Source

添加兑换成功事件

zhangyuqian 1 year ago
parent
commit
360f8d5cee

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

@@ -254,5 +254,7 @@ namespace GFGGame
         public const string NEWROLEGETSUIT = "NEWROLE_GETSUIT";
         //搭配学院升级成功
         public const string COLLEGE_UPGRADE = "COLLEGE_UPGRADE";
+        //兑换成功
+        public const string EXCHANGE_SUCCESS = "EXCHANGE_SUCCESS";
     }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/ItemExchangeSProxy.cs

@@ -13,7 +13,7 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     ItemDataManager.InitItemExchange(response.ItemId, response.ExchangedTimes);
-                    // EventAgent.DispatchEvent(ConstMessage.SHOP_BUY);
+                    EventAgent.DispatchEvent(ConstMessage.EXCHANGE_SUCCESS);
                     return true;
                 }
             }

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/PopWindow/ExchangeGoodsView.cs

@@ -45,12 +45,14 @@ namespace GFGGame
         {
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateItem);
+            EventAgent.AddEventListener(ConstMessage.EXCHANGE_SUCCESS, ShowTips);
         }
 
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateItem);
+            EventAgent.RemoveEventListener(ConstMessage.EXCHANGE_SUCCESS, ShowTips);
         }
 
         protected override void OnShown()
@@ -177,5 +179,9 @@ namespace GFGGame
             _ui.m_txtHasNum.text = "ÒÑÓµÓÐ:" + hasNum;
             _ui.m_listConsume.numItems = itemCfg.param1Arr.Length;
         }
+        private void ShowTips()
+        {
+            PromptController.Instance.ShowFloatTextPrompt("¶Ò»»³É¹¦");
+        }
     }
 }