Пример #1
0
        //开启宝箱
        public void OnOpenChestResult()
        {
            //宝箱开启动画播放过程中是不允许关闭宝箱整个UI的
            bEnableClose = false;

            foreach (PrizeResultItem item in prizeResultList)
            {
                item.Clear();
            }

            cmd_entity_open_chest_result resultInfo = LogicDataCenter.prizeChestDataManager.OpenChestResult;

            m_nResultPageChestType = resultInfo.nChestType;

            //隐藏主界面UI
            chestPageObj.SetActive(false);
            closeBtn.gameObject.SetActive(false);
            ClearContainer(prizeResultObjContainer);

            if (!m_isFromNextChestBtn)
            {
                //加载宝箱动画场景
                SceneManager.Instance.LoadTreasureBoxAwardViewScene(SetPrizeResultObjContainer);
            }
            else
            {
                m_isFromNextChestBtn = false;
                LoadPrizeResultEffectAndSetUIData();
            }


            //更新宝箱入口红点数量
            Dictionary <int, int> selfChestInfo = LogicDataCenter.prizeChestDataManager.ChestInfo;
            int nLeftNum = 0;

            if (selfChestInfo.ContainsKey(m_nResultPageChestType))
            {
                nLeftNum = selfChestInfo[m_nResultPageChestType];
            }

            //更新继续开启按钮的交互属性,如果剩余宝箱数为0,则置灰
            //    continueOpenBtn.interactable = (nLeftNum > 0);
            //    continueLeftDesc.text = String.Format(ULocalizationService.Instance.Get("UIView", "PrizeChest", "ChestHaveNumDesc"), nLeftNum);
        }
Пример #2
0
        //public void OnOpenChestResult(IntPtr ptrParam, int nPtrLen)
        //{
        //    m_openChestResult = IntPtrHelper.toData<cmd_entity_open_chest_result>(ptrParam);

        //    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PRIZECHEST_OPENCHESTRESULT, null);
        //}

        //public void OnReturnRandCardInfo(IntPtr ptrParam, int nPtrLen)
        //{
        //    IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);
        //    int nPrizeID = helper.get<int>();
        //    int nCount = helper.get<int>();

        //    SRandCardResult cardInfo = new SRandCardResult();
        //    cardInfo.nPrizeId = nPrizeID;
        //    cardInfo.cardResult = new List<cmd_entity_hero_card>();
        //    for (int i = 0; i < nCount; i++)
        //    {
        //        cmd_entity_hero_card data = helper.get<cmd_entity_hero_card>();
        //        cardInfo.cardResult.Add(data);
        //    }

        //    cardInfo.cardResult.Sort(CompareMember);
        //    m_randCardResult.Add(cardInfo);
        //}

        public void OnOpenChestResult(IntPtr ptrParam, int nPtrLen)
        {
            m_openChestResult = IntPtrHelper.toData <cmd_entity_open_chest_result>(ptrParam);

            // 卡包要拆成具体卡牌显示,所以去除卡包奖励,加入已赋值过的m_randCardResult(type为6的为策划卡包ID,901为策划预留卡牌ID)
            for (int i = 0; i < m_openChestResult.nPrizeID.Length; i++)
            {
                m_PrizeIdList.Add(m_openChestResult.nPrizeID[i]);
            }
            //m_PrizeIdList.RemoveAll(it => (it == 0 || (it >= 1511 && it <= 1514)));
            for (int i = m_PrizeIdList.Count - 1; i >= 0; --i)
            {
                if (m_PrizeIdList[i] == 0)
                {
                    m_PrizeIdList.Remove(m_PrizeIdList[i]);
                    continue;
                }

                SSchemeActorPrizeConfig config = ActorPrizeConfig.Instance.GetActorPrizeConfig(m_PrizeIdList[i]);
                if (config != null && config.nPrizeType == (int)EMActorPrizeType.ACTOR_PRIZE_HEROCARD_RANDOM)
                {
                    m_PrizeIdList.Remove(m_PrizeIdList[i]);
                }
            }

            // 按数量从大到小排序
            List <SSchemeActorPrizeConfig> temp = new List <SSchemeActorPrizeConfig>();

            foreach (var item in m_randCardResult)
            {
                temp.Add(item.Value);
            }
            temp.Sort(CompareMember);

            foreach (var config in temp)
            {
                m_PrizeIdList.Add(config.nPrizeID);
            }

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PRIZECHEST_OPENCHESTRESULT, null);
        }