private void UpdateMessage() { if (updater.state == AssetsUpdate.State.Error) { message = $"{"ERROR: "}{updater.message}"; progress = 0.1f; } else if (updater.state == AssetsUpdate.State.Wait) { message = LT.Get("READY_UPDATE_RESOURCE"); progress = 0.05f; } else if (updater.state == AssetsUpdate.State.Checking) { message = LT.Get("CHECK_UPDATE_RESOURCE"); progress = 0.1f; } else if (updater.state == AssetsUpdate.State.Downloading) { message = $"{LT.Get("UPDATE_RESOURCE")}[{updater.downloadIndex}/{updater.downloadCount}]"; progress = updater.progress * 0.7f + 0.1f; } else if (updater.state == AssetsUpdate.State.Completed && !mQuickHotUpdateFinished) { message = $"{LT.Get("QUICK_UPDATE_RESOURCE")}[{mQuickHotUpdateIndex}/{mQuickHotUpdateList.Count}]"; progress = ((mQuickHotUpdateIndex + mQuickHotUpdateProgress) / mQuickHotUpdateList.Count) * 0.2f + 0.8f; } }
public void SetData(int id, float time) { this.id = id; this.startTime = time; this.table = TableBuff.Get(id); this.name = LT.Get(table.nameID); }
public void SetData(int goodsID) { mTable = TableShop.Get(goodsID); title.text = LT.Get(mTable.nameID); icon.SetSprite(mTable.image); price.text = LT.Get(mTable.priceID); extraObj.SetActive(mTable.extra > 0); extra.text = $"+{mTable.extra}"; }
public void SetData(int id) { mId = id; var table = TableWeapon.Get(id); icon.SetSprite(table.icon); icon.SetGrey(D.I.unlockedGameLevel < table.unlockLevel); title.text = LT.Get(table.nameID); selectedObj.SetActive(id == D.I.weaponId); radioState.Radio(D.I.unlockedGameLevel < table.unlockLevel ? 0 : D.I.weaponId == id ? 2 : 1); unlockText.text = LTKey.WEAPON_UNLOCK_ON_GAME_LEVEL_X.LT(table.unlockLevel - 1); trialTag.SetActive(!D.I.noAd && D.I.GetTrialWeaponID() == id && !D.I.IsInTrial()); }
public void Set4LevelUp(float costCoin, bool isMax) { if (isMax) { SetText(LT.Get("LEVEL_MAX")); } else { SetText(costCoin.KMB()); } SetBtnGrey(isMax || costCoin > D.I.coin); SetTextRed(!isMax && costCoin > D.I.coin); }
private void Update() { if (string.IsNullOrEmpty(LTKey)) { return; } if (mLastLanguage != Option.language) { targetText.text = LT.Get(LTKey, args); mLastLanguage = Option.language; } }
private void RefreshUI() { var rewards = new List <Tuple <string, string> > { new Tuple <string, string>("icon_vip_fund", LT.Get("vipRewardFund")), new Tuple <string, string>("icon_vip_diamond", LT.Get("vipRewardDiamond")), new Tuple <string, string>("icon_vip_ad", LT.Get("vipRewardAd")), new Tuple <string, string>("icon_vip_difficulty", LT.Get("vipRewardDifficulty")), new Tuple <string, string>("icon_vip_revival", LT.Get("vipRewardRevival")), }; rewardGroup.SetData <VipRewardItem, Tuple <string, string> >(rewards); radioBtn.Radio(!D.I.IsVip() ? 0 : D.I.HasVipReward() ? 1 : 2); expirationObj.SetActive(D.I.IsVip() && false); if (D.I.IsVip()) { expirationTime.text = D.I.VipExpirationDate().ToString("yyyy-MM-dd HH:mm:ss"); } }
private void OnEventGameDataWhenever(EventGameData evt) { if (evt.action == EventGameData.Action.UnlockNewLevel) { if (D.I.unlockedGameLevel == 2) { needOpenTutorial = true; } else if (!GameLocalData.Instance.isRateOver) { foreach (var lv in CT.table.rateUsHintLevel) { if (lv == D.I.unlockedGameLevel - 1) { needOpenRate = true; break; } } } if (D.I.unlockedGameLevel == CT.table.dailySignUnlockLevel) { mOpenHints.Add(LTKey.UNLOCK_SYSTEM_X.LT(LTKey.DAILY_SIGN.LT())); } if (D.I.unlockedGameLevel == CT.table.bookUnlockLevel) { mOpenHints.Add(LTKey.UNLOCK_SYSTEM_X.LT(LTKey.VIRUS_BOOK.LT())); } if (D.I.unlockedGameLevel == CT.table.weaponUnlockLevel) { mOpenHints.Add(LTKey.UNLOCK_SYSTEM_X.LT(LTKey.WEAPON_SYSTEM.LT())); } foreach (var t in TableWeapon.GetAll()) { if (D.I.unlockedGameLevel == t.unlockLevel) { mOpenHints.Add(LTKey.UNLOCK_WEAPON_X.LT(LT.Get(t.nameID))); } } } }
public void SetData(int days) { var t = TableDailySign.Get(days); title.text = LT.Get(t.nameID); image.SetSprite(t.icon); if (t.type == 2) // coin { count.text = "x" + t.count * FormulaUtil.Expresso(CT.table.formulaArgsDailySignCoin); } else { count.text = "x" + t.count; } if (days == D.I.signDays) { if (D.I.CanDailySign()) { stateRadio.Radio(1); } else { stateRadio.Radio(0); } } else { if (days < D.I.signDays) { stateRadio.Radio(2); } else { stateRadio.Radio(0); } } bgRadio.Radio(stateRadio.index); btn.clickEventID = days; }