Exemplo n.º 1
0
    public void initView()
    {
        NovicePacksPush novicePacksPush = NewPeoperGiftPackageManager.Instance.getNovicePacksPush();

        if (novicePacksPush == null)
        {
            Debug.LogWarning("服务器推送的NovicePacksPush数据null,检测客户端或者服务器推送的数据.");
            return;
        }
        base.FindTransform("ButtonBuyPro").FindChild("BtnConfirmText").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(301027, false));
        XinShouLiBao xinShouLiBao = DataReader <XinShouLiBao> .Get(novicePacksPush.pack.id);

        if (xinShouLiBao != null)
        {
            Icon icon = DataReader <Icon> .Get(xinShouLiBao.Chinese);

            if (icon != null)
            {
                ResourceManager.SetSprite(base.FindTransform("IconImage").GetComponent <Image>(), ResourceManager.GetIconSprite(icon.icon));
            }
        }
        base.FindTransform("Count").GetComponent <Text>().set_text("X" + novicePacksPush.pack.price);
        ListPool pool = this.m_ItemPool;

        pool.Release();
        pool.Create(novicePacksPush.pack.items.get_Count(), delegate(int index)
        {
            DropItem dropItem = novicePacksPush.pack.items.get_Item(index);
            int typeId        = dropItem.typeId;
            long count        = dropItem.count;
            ItemShow.SetItem(pool.Items.get_Item(index), typeId, count, false, UINodesManager.T2RootOfSpecial, 3000);
        });
    }
 public void OnUpdatePanel(short state, NovicePacksPush novicePacksPush = null)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     this.UpdateData(novicePacksPush);
     if (NewPeoperGiftPackage.Instance != null)
     {
         NewPeoperGiftPackage.Instance.showEffect(true);
     }
     this.startTimeCoundDown(novicePacksPush.time);
 }
Exemplo n.º 3
0
    private void OnBuyProductClicked(GameObject go)
    {
        NovicePacksPush novicePacksPush = NewPeoperGiftPackageManager.Instance.getNovicePacksPush();

        if (novicePacksPush.pack.price > EntityWorld.Instance.EntSelf.Diamond)
        {
            DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(510106, false), GameDataUtils.GetChineseContent(510107, false), delegate
            {
            }, delegate
            {
                this.OnClickMaskAction();
                LinkNavigationManager.OpenVIPUI2Recharge();
            }, GameDataUtils.GetChineseContent(505113, false), GameDataUtils.GetChineseContent(505114, false), "button_orange_1", "button_yellow_1", null, true, true);
        }
        else
        {
            base.FindTransform("ButtonBuyPro").GetComponent <ButtonCustom>().set_enabled(false);
            NewPeoperGiftPackageManager.Instance.sendBuyDiscountItemReq();
        }
    }
 private void UpdateData(NovicePacksPush packsPush)
 {
     this.novicePacksPush = packsPush;
 }