Exemplo n.º 1
0
        public override void OnShow(object param)
        {
            base.OnShow(param);

            GameEvents.UIEvents.UI_Bonus_Pop_View_Event.Tell_OnBlock.SafeInvoke(true);

            if (param == null)
            {
                return;
            }
            m_OK.AddClickCallBack(OnClick);
            m_spine.Visible = false;

            if (param is SCDropResp)
            {
                SCDropResp giftData = (SCDropResp)param;
                OnInitData(new List <DropInfo>(giftData.DropInfos));
                ShowProp();
            }
            else if (param is SCAutoOpenGiftDropResp)
            {
                SCAutoOpenGiftDropResp giftData = (SCAutoOpenGiftDropResp)param;
                OnInitData(new List <DropInfo>(giftData.DropInfos));
                ShowGift();
            }
            else if (param is ResultWindowData)
            {
                ResultWindowData windowData = param as ResultWindowData;
                OnInitResultData(windowData);
                ShowProp();
            }
        }
Exemplo n.º 2
0
        //纯展示
        private void OnInitResultData(ResultWindowData data)
        {
            int count = data.m_itemDatas.Count;

            m_Grid.EnsureSize <GiftContent>(count);
            for (int i = 0; i < count; i++)
            {
                GiftContent giftContent = m_Grid.GetChild <GiftContent>(i);
                giftContent.SetData(data.m_itemDatas[i]);
                giftContent.SetTargetTransform(this.m_bagTrans);
                giftContent.Visible = true;
            }
        }
 private void OnRes(object obj)
 {
     if (obj is SCSkyEyeRewardReq)
     {
         SCSkyEyeRewardReq     res           = (SCSkyEyeRewardReq)obj;
         List <ResultItemData> itemDataArray = new List <ResultItemData>();
         for (int i = 0; i < res.Items.Count; i++)
         {
             ResultItemData itemData = new ResultItemData(res.Items[i].PropId, res.Items[i].Num);
             itemDataArray.Add(itemData);
         }
         ResultWindowData      resultData = new ResultWindowData(itemDataArray);
         FrameMgr.OpenUIParams param      = new FrameMgr.OpenUIParams(UIDefine.UI_GIFTRESULT);
         param.Param = resultData;
         EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param);
         GlobalInfo.MY_PLAYER_INFO.AddSkyEyeHasRewardById(res.SkyEyeId);
         PresuadeUILogic.Hide();
         GameEvents.UIEvents.UI_SkyEye_Event.OnSkyEyeCompleteById.SafeInvoke(this.skyeyeId);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 购买回调
        /// </summary>
        /// <param name="res"></param>
        private void OnBuyCallback(MarkeBuyResponse res)
        {
            if (request_Type != m_curType)
            {
                return;
            }
            if (res.ResponseStatus != null)
            {
                PopUpManager.OpenNormalOnePop("shop_rmb_no");
                requestShopData();
            }
            else
            {
                if (request_ID == m_curChooseID)
                {
                    request_Type = ShopType.None;
                    ShopItemData curItemdata = getShopDataByID();
                    if (curItemdata != null)
                    {
                        //PopUpManager.OpenNormalOnePop("shop_rmb_ok");
                        ConfProp prop = ConfProp.Get(curItemdata.m_prop.id);
                        if (prop != null && prop.type != 3)
                        {
                            ResultWindowData windowDatas = new ResultWindowData(new List <ResultItemData> {
                                new ResultItemData(curItemdata.m_prop.id, total_prop_count)
                            });
                            FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_GIFTRESULT);
                            param.Param = windowDatas;
                            EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param);
                        }
                        //CommonHelper.OpenGift(curItemdata.m_prop.id, request_Market_Count);
                        if (curItemdata.m_limitNumber > 0)
                        {
                            curItemdata.m_limitNumber -= request_Market_Count;
                        }
                        m_shopInfo_com.setPanel(curItemdata, m_curType);
                        int cost = 0;
                        if (curItemdata.m_hasDis)
                        {
                            cost = curItemdata.m_disPrice * request_Market_Count;
                        }
                        else
                        {
                            cost = curItemdata.m_oriPrice * request_Market_Count;
                        }
                        GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(curItemdata.m_prop.id, total_prop_count);

                        GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke();

                        if (curItemdata.m_costType == CostType.CostCash)
                        {
                            GlobalInfo.MY_PLAYER_INFO.ChangeCash(-cost);
                        }
                        else if (curItemdata.m_costType == CostType.CostCoin)
                        {
                            GlobalInfo.MY_PLAYER_INFO.ChangeCoin(-cost);
                        }
                        Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>()
                        {
                            { UBSParamKeyName.ContentID, curItemdata.marketID },
                            { UBSParamKeyName.NumItems, request_Market_Count }
                        };

                        if (m_curType == ShopType.Prop)
                        {
                            UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.shop_buy, null, _params);
                        }

                        if (curItemdata.m_limitNumber == 0 && m_curType == ShopType.Prop)
                        {
                            requestShopData();
                        }
                        else if (m_curType == ShopType.BlackMarket)
                        {
                            requestShopData();
                            UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.blackmarket_buy, null, _params);
                        }
                        //GlobalInfo.MY_PLAYER_INFO.SetCoin(res.PlayerBaseInfo.Coin);
                    }
                }
            }
        }