Пример #1
0
    private async void SubmintDealCallback(SCSubmintDeal sCSubmintDeal)
    {
        if (sCSubmintDeal == null)
        {
            _butSubmint.interactable = true;
            return;
        }
        _showAwardDatas.Clear();

        _curDealType = _currDeal.DealType;

        //发放奖励 道具入库
        for (int i = 0; i < _currDeal.DealAwardInfo.Count; i++)
        {
            //需要展示的物品
            CSWareHouseStruct cSWareHouseStruct = new CSWareHouseStruct();
            cSWareHouseStruct.GoodId  = _currDeal.DealAwardInfo[i].GoodId;
            cSWareHouseStruct.GoodNum = _currDeal.DealAwardInfo[i].GoodNum;
            cSWareHouseStruct.IsLock  = true;
            _showAwardDatas.Add(cSWareHouseStruct);

            var item       = StaticData.configExcel.GetGameItemByID(cSWareHouseStruct.GoodId);
            var itemSprite = await ABManager.GetAssetAsync <Sprite>(item.Icon);

            //世界坐标转换为屏幕坐标
            var pos = Camera.main.WorldToScreenPoint(transform.position);
            StaticData.OpenPickupItemEffectNew(itemSprite, 0.35f, pos, cSWareHouseStruct.GoodId, cSWareHouseStruct.GoodNum, null /*PickUpItemEffectComplete*/);
        }
        //移除需要的物品
        for (int i = 0; i < _currDeal.DealNeedGoods.Count; i++)
        {
            StaticData.UpdateWareHouseItem(_currDeal.DealNeedGoods[i].GoodId, _currDeal.DealNeedGoods[i].GoodNum * -1);
        }

        //更新完成订单数
        int dealLevel = (int)_currDeal.DealType - 1;

        dealLevel = dealLevel >= 0 ? dealLevel : 0;
        StaticData.AddDealCompleteValue(dealLevel);

        //更新订单数据
        _currDeal = sCSubmintDeal.NewDealInfo;
        StaticData.UpdateDeal(_currDeal);

        //道具入库
        ItemPropsWarehousing();
    }
Пример #2
0
    public void ScrollCellIndex(int idx)
    {
        //
        Init();

        //获取订单数据
        _currDeal = null;
        if (StaticData.playerInfoData.CurrDeals.DealInfo.Count > idx)
        {
            _currDeal = StaticData.playerInfoData.CurrDeals.DealInfo[idx];
        }

        //添加监听
        if (UIDealController.Instance != null)
        {
            UIDealController.Instance.RefreshNotify -= DealControllerNotifyRefreshShow;
            UIDealController.Instance.RefreshNotify += DealControllerNotifyRefreshShow;
        }

        UpdateShow(true);
    }