public void CheckCanBuyFlag(bool isCast = false) { if (EntityWorld.Instance.EntSelf == null) { return; } bool flag = !this.hasBuy; if (flag) { XiTongCanShu xiTongCanShu = DataReader <XiTongCanShu> .Get("openLv"); if (int.Parse(xiTongCanShu.value) > EntityWorld.Instance.EntSelf.Lv) { flag = false; } } if (isCast) { this.SetTipOfCanBuy(flag); } else { this.IsShowTipsOfCanBuy = flag; } }
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 AddFirstScrollCell() { bool hasBuy = InvestFundManager.Instance.hasBuy; bool hasGet = InvestFundManager.Instance.hasGet; bool isOver = false; string chineseContent = GameDataUtils.GetChineseContent(508205, false); XiTongCanShu xiTongCanShu = DataReader <XiTongCanShu> .Get("restoreImmediately"); string value = xiTongCanShu.value; Transform transform = this.m_ScrollList.get_transform().FindChild("InvestItemFirst"); if (transform != null) { transform.get_gameObject().SetActive(true); transform.GetComponent <InvestItem>().UpdateItem(0, chineseContent, value, hasBuy, hasGet, isOver, new ButtonCustom.VoidDelegateObj(this.OnFirstBtnClick)); } else { GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("InvestItem"); instantiate2Prefab.get_transform().SetParent(this.m_ScrollList.get_transform(), false); instantiate2Prefab.set_name("InvestItemFirst"); instantiate2Prefab.SetActive(true); instantiate2Prefab.GetComponent <InvestItem>().UpdateItem(0, chineseContent, value, hasBuy, hasGet, isOver, new ButtonCustom.VoidDelegateObj(this.OnFirstBtnClick)); } }
protected override void InitUI() { base.InitUI(); this.m_ScrollList = base.FindTransform("ScrollList").GetComponent <GridLayoutGroup>(); this.m_ScrollInvest = base.FindTransform("ScrollInvest").GetComponent <RectTransform>(); XiTongCanShu xiTongCanShu = DataReader <XiTongCanShu> .Get("cost"); XiTongCanShu xiTongCanShu2 = DataReader <XiTongCanShu> .Get("restoreImmediately"); base.FindTransform("TextDesc").GetComponent <Text>().set_text(string.Format(GameDataUtils.GetChineseContent(508200, false), xiTongCanShu.value, xiTongCanShu2.value)); base.FindTransform("BtnInvest").GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnInvest); this.panelBtnSpine = base.FindTransform("PanelBtnSpine"); this.panelBtnSpine.set_localScale(new Vector3(1f, 1f, 1f)); }