public void ExecutionToRechargeDiamond(int id) { RechargeGoodsInfo rechargeGoodsInfo = this.GetRechargeGoodsInfo(id); if (rechargeGoodsInfo == null) { return; } if (SDKManager.Instance.HasSDK()) { if (SDKManager.Instance.IsAndroidYSDK()) { WaitUI.OpenUI(8000u); SDKManager.Instance.CheckBalanceOnPay(rechargeGoodsInfo.ID.ToString(), "钻石", (double)rechargeGoodsInfo.rmb); } else { WaitUI.OpenUI(5000u); SDKManager.Instance.Pay(rechargeGoodsInfo.ID.ToString(), "钻石", (double)rechargeGoodsInfo.rmb); } } else { WaitUI.OpenUI(3000u); this.SendRechargeDiamond(id); } }
private void OnClickBtnInvest(GameObject sender) { if (InvestFundManager.Instance.hasBuy) { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(508202, false)); return; } XiTongCanShu xiTongCanShu = DataReader <XiTongCanShu> .Get("openLv"); if (int.Parse(xiTongCanShu.value) > EntityWorld.Instance.EntSelf.Lv) { UIManagerControl.Instance.ShowToastText(string.Format(GameDataUtils.GetChineseContent(508204, false), xiTongCanShu.value)); return; } RechargeGoodsInfo rechargeMonthGoodsInfo = RechargeManager.Instance.GetRechargeMonthGoodsInfo(); int nowRechargeId = 11; string content = string.Empty; if (rechargeMonthGoodsInfo != null) { content = string.Format(GameDataUtils.GetChineseContent(508203, false), rechargeMonthGoodsInfo.rmb); nowRechargeId = rechargeMonthGoodsInfo.ID; } DialogBoxUIViewModel.Instance.ShowAsOKCancel(string.Empty, content, null, delegate { RechargeManager.Instance.ExecutionToRechargeDiamond(nowRechargeId); }, GameDataUtils.GetChineseContent(500012, false), GameDataUtils.GetChineseContent(500011, false), "button_orange_1", "button_yellow_1", null, true, true); }
private void Diamond() { RechargeGoodsInfo rechargeGoodsInfo = RechargeManager.Instance.GetRechargeGoodsInfo(this.ID); if (rechargeGoodsInfo != null) { UIManagerControl.Instance.OpenUI("DiamondBuyUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush); DiamondBuyUIViewModel.Instance.Icon = GameDataUtils.GetIcon(rechargeGoodsInfo.diamondsIcon); DiamondBuyUIViewModel.Instance.Info1 = string.Format(GameDataUtils.GetChineseContent(508008, false), rechargeGoodsInfo.diamonds); DiamondBuyUIViewModel.Instance.Info2_1 = string.Format(GameDataUtils.GetChineseContent(508028, false), rechargeGoodsInfo.rmb); DiamondBuyUIViewModel.Instance.CallBack = delegate { RechargeManager.Instance.ExecutionToRechargeDiamond(this.ID); }; } }
private void OnRechargeGoodsRes(short state, RechargeGoodsRes down = null) { WaitUI.CloseUI(0u); if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down != null) { this.IsNeedRefresh = false; this.m_listRechargeGoodsInfo = new List <RechargeGoodsInfo>(); int sDKType = SDKManager.Instance.GetSDKType(); for (int i = 0; i < down.Info.get_Count(); i++) { if (down.Info.get_Item(i).channel == sDKType) { this.m_listRechargeGoodsInfo.Add(down.Info.get_Item(i)); } } if (this.m_listRechargeGoodsInfo.get_Count() == 0) { for (int j = 0; j < down.Info.get_Count(); j++) { if (down.Info.get_Item(j).channel == 0) { this.m_listRechargeGoodsInfo.Add(down.Info.get_Item(j)); } } } this.RechargeIds.Clear(); this.RechargeBoxs.Clear(); for (int k = 0; k < this.m_listRechargeGoodsInfo.get_Count(); k++) { RechargeGoodsInfo rechargeGoodsInfo = this.m_listRechargeGoodsInfo.get_Item(k); this.RechargeIds.Add(rechargeGoodsInfo.indexes); if (rechargeGoodsInfo.dropID.get_Count() > 0) { this.RechargeBoxs.Add(rechargeGoodsInfo.indexes); } } EventDispatcher.Broadcast("RechargeManager.RechargeGoodsInfoUpdate"); this.CheckBoxTips(); } }
private void BuyBox() { RechargeGoodsInfo rechargeGoodsInfo = RechargeManager.Instance.GetRechargeGoodsInfo(this.ID); if (rechargeGoodsInfo != null) { int todayRechargeCount = RechargeManager.Instance.GetTodayRechargeCount(this.ID); if (todayRechargeCount > 0) { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(517002, false)); return; } Dict dict = rechargeGoodsInfo.dropID.get_Item(0); BoxBuyUI boxBuyUI = UIManagerControl.Instance.OpenUI("BoxBuyUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as BoxBuyUI; boxBuyUI.SetShowItem(dict.key, delegate { RechargeManager.Instance.ExecutionToRechargeDiamond(this.ID); }); } }