private async void RequestUseHuaFei(int huafei, int type)
        {
            UINetLoadingComponent.showNetLoading();
            G2C_UseHuaFei g2cUseHuaFei = (G2C_UseHuaFei)await SessionComponent.Instance.Session.Call(new C2G_UseHuaFei { Uid = PlayerInfoComponent.Instance.uid, HuaFei = huafei, Phone = PlayerInfoComponent.Instance.GetPlayerInfo().Phone, Type = type });

            UINetLoadingComponent.closeNetLoading();

            if (g2cUseHuaFei.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cUseHuaFei.Message);

                return;
            }

            GameUtil.changeData(3, -huafei);

            // 兑换话费
            if (type == 1)
            {
                ++HuaFei_5_RestCount;
                ToastScript.createToast((huafei / 100.0f).ToString() + "元话费兑换成功");
            }
            // 兑换元宝
            else if (type == 2)
            {
                ++YuanBao_RestCount;
                GameUtil.changeDataWithStr(g2cUseHuaFei.Reward);
                ShowRewardUtil.Show(g2cUseHuaFei.Reward);
            }

            Button_HuaFei.transform.Find("Text").GetComponent <Text>().text = "兑换 " + HuaFei_5_RestCount + "/1";
            Button_Key.transform.Find("Text").GetComponent <Text>().text    = "兑换 " + YuanBao_RestCount + "/10";
        }
Exemple #2
0
        private async void GetWeekReward()
        {
            UINetLoadingComponent.showNetLoading();
            G2C_GetWeekReward g2cWR = (G2C_GetWeekReward)await Game.Scene.GetComponent <SessionComponent>()
                                      .Session.Call(new C2G_GetWeekReward {
                UId = PlayerInfoComponent.Instance.uid, type = curType
            });

            UINetLoadingComponent.closeNetLoading();

            if (g2cWR.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cWR.Message);
                return;
            }
            RewardBtn.gameObject.SetActive(false);
            g2cWeek.IsGetGameRank = g2cWR.IsGetGameRank;
            g2cWeek.IsGetGoldRank = g2cWR.IsGetGoldRank;
            string str = "";

            if (curType == 1)
            {
                str = "2:" + g2cWR.GoldReward;
                //ToastScript.createToast($"领取成功,获得元宝{g2cWR.GoldReward}");
            }
            else if (curType == 2)
            {
                str = "111:" + g2cWR.GameReward;
                /* ToastScript.createToast($"领取成功,获得话费礼包{g2cWR.GameReward}");*/
            }
            ShowRewardUtil.Show(str);
        }
        private async void GetReward()
        {
            UINetLoadingComponent.showNetLoading();
            G2C_GetTaskReward g2cGet = (G2C_GetTaskReward)await SessionComponent.Instance.Session.Call(new C2G_GetTaskReward { UId = PlayerInfoComponent.Instance.uid, TaskInfo = info, GetType = 2 });

            UINetLoadingComponent.closeNetLoading();

            if (g2cGet.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cGet.Message);
            }
            else
            {
                GameUtil.changeData(1, info.Reward);
                Game.Scene.GetComponent <UIComponent>().Get(UIType.UIMain)
                .GetComponent <UIMainComponent>().refreshUI();

                string str = "1:" + info.Reward;
                ShowRewardUtil.Show(str);
                string icon = new StringBuilder().Append("chengjiu_")
                              .Append(info.Id).ToString();
                Debug.Log("已经领取成就奖励");
                Game.Scene.GetComponent <UIComponent>().Get(UIType.UIChengjiu).GetComponent <UIChengjiuComponent>().DeCount();
                Complete.SetActive(false);
                ChengjiuItemBtn.GetComponent <Image>().sprite =
                    CommonUtil.getSpriteByBundle("uichengjiuicon", icon);
            }
        }
        private async void RequestRealName()
        {
            UINetLoadingComponent.showNetLoading();
            G2C_RealName g2cRealName = (G2C_RealName)await SessionComponent.Instance.Session.Call(new C2G_RealName { Uid = PlayerInfoComponent.Instance.uid, Name = InputField_name.text, IDNumber = InputField_idNumber.text });

            UINetLoadingComponent.closeNetLoading();

            if (g2cRealName.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cRealName.Message);

                return;
            }

            PlayerInfoComponent.Instance.GetPlayerInfo().IsRealName = true;

            GameUtil.changeData(1, 3000);

            ShowRewardUtil.Show("1:3000");

            ToastScript.createToast("认证成功");

            Game.Scene.GetComponent <UIComponent>().Get(UIType.UIPlayerInfo).GetComponent <UIPlayerInfoComponent>().Update();
            Game.Scene.GetComponent <UIComponent>().Remove(UIType.UIRealName);
        }
Exemple #5
0
        private async void RequestDailySign()
        {
            UINetLoadingComponent.showNetLoading();

            G2C_DailySign g2cDailySign = (G2C_DailySign)await SessionComponent.Instance.Session.Call(new C2G_DailySign { Uid = PlayerInfoComponent.Instance.uid });

            UINetLoadingComponent.closeNetLoading();

            if (g2cDailySign.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cDailySign.Message);

                return;
            }

            string reward = g2cDailySign.Reward;

            GameUtil.changeDataWithStr(reward);

            ShowRewardUtil.Show(reward);

            PlayerInfoComponent.Instance.GetPlayerInfo().IsSign = true;

            {
                Button btn = Item2.transform.Find("Button").GetComponent <Button>();
                btn.interactable = false;
                btn.GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_main", "DayDo_tomorrow");

                string TomorrowReward = g2cDailySign.TomorrowReward;
                int    prop_id        = CommonUtil.splitStr_Start(TomorrowReward, ':');
                int    prop_num       = CommonUtil.splitStr_End(TomorrowReward, ':');
                Item2.transform.Find("Text").GetComponent <Text>().text = ("奖励 <color=#FF8604FF>" + prop_num + "</color>金币");
            }
        }
Exemple #6
0
        public async void startXuanZhuan(int itemId)
        {
            isDispose = false;

            for (int m = 1; m <= 5; m++)
            {
                for (int i = 0; i < ZhuanPanConfig.getInstance().getZhuanPanInfoList().Count; i++)
                {
                    if (isDispose)
                    {
                        return;
                    }

                    ZhuanPanInfo zhuanpanInfo = ZhuanPanConfig.getInstance().getZhuanPanInfoList()[i];
                    GameObject   item         = Item.transform.Find("Item_" + zhuanpanInfo.itemId).gameObject;
                    xuanzhongItem(zhuanpanInfo.itemId);

                    if ((m == 5) && (zhuanpanInfo.itemId == itemId))
                    {
                        //ToastScript.createToast("恭喜您获得" + item.transform.Find("Text_reward").GetComponent<Text>().text);
                        m_canClick = true;
                        ShowRewardUtil.Show(m_curReward);
                        return;
                    }

                    await ETModel.Game.Scene.GetComponent <TimerComponent>().WaitAsync(50);
                }
            }
        }
Exemple #7
0
        private async void GetItem()
        {
            List <GetItemInfo> itemList = new List <GetItemInfo>();

            for (int i = 0; i < rewardList.Count; ++i)
            {
                GetItemInfo itemInfo = new GetItemInfo();
                itemInfo.ItemID = rewardList[i].itemId;
                itemInfo.Count  = rewardList[i].rewardNum;
                itemList.Add(itemInfo);
            }

            UINetLoadingComponent.showNetLoading();
            G2C_EmailOperate g2cGetItem = (G2C_EmailOperate)await SessionComponent.Instance
                                          .Session.Call(new C2G_EmailOperate
            {
                Uid     = PlayerInfoComponent.Instance.uid,
                EmailId = (int)email.EId,
                state   = 1
            });

            UINetLoadingComponent.closeNetLoading();

            get.gameObject.SetActive(false);
            GameUtil.changeDataWithStr(email.RewardItem);
            ShowRewardUtil.Show(email.RewardItem);
            flag.SetActive(false);
            Delete.gameObject.SetActive(true);
            Game.Scene.GetComponent <UIComponent>().Get(UIType.UIEmail).GetComponent <UIEmailComponent>().RefreshMailUI();
            Game.Scene.GetComponent <UIComponent>().Get(UIType.UIEmail).GetComponent <UIEmailComponent>().DeCount();
        }
Exemple #8
0
        private async void GetReward()
        {
            UINetLoadingComponent.showNetLoading();
            G2C_GetTaskReward g2cGetItem = (G2C_GetTaskReward)await SessionComponent.Instance.Session.Call(new C2G_GetTaskReward { UId = PlayerInfoComponent.Instance.uid, TaskInfo = taskProgress, GetType = 1 });

            UINetLoadingComponent.closeNetLoading();

            if (g2cGetItem.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cGetItem.Message);
            }
            else
            {
                GameUtil.changeData(1, taskProgress.Reward);
                RefreshUI(true);
                string str = "1:" + taskProgress.Reward;
                ShowRewardUtil.Show(str);
                Game.Scene.GetComponent <UIComponent>().Get(UIType.UITask).GetComponent <UITaskComponent>().DeCount();
                Game.Scene.GetComponent <UIComponent>().Get(UIType.UIMain)
                .GetComponent <UIMainComponent>().refreshUI();
            }
        }
        private async void GetTreasure()
        {
            UINetLoadingComponent.showNetLoading();
            G2C_GetFriendTreasure g2cFrd = (G2C_GetFriendTreasure)await SessionComponent.Instance.Session.Call(new C2G_GetFriendTreasure()
            {
                UId = PlayerInfoComponent.Instance.uid
            });

            UINetLoadingComponent.closeNetLoading();

            if (g2cFrd.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cFrd.Message);
                SetButtonEnable();
                return;
            }

            GameUtil.changeDataWithStr(g2cFrd.Reward);
            ShowRewardUtil.Show(g2cFrd.Reward);
            DeCount();
            GetFriendActInfo();

            SetButtonEnable();
        }