public void OnCancelBtnClick() { GlobalMenuManager.Instance.RemoveCache("LTResourceInstanceUI"); mActivityId = 0; mChooseLevel = null; mInstanceType = ResourceInstanceType.Null; }
public bool IsLock(Hotfix_LT.Data.SpecialActivityLevelTemplate level, ResourceInstanceType type) { if (type == ResourceInstanceType.Gold) { return(level.id > mPassDifficeGlod); } else if (type == ResourceInstanceType.Exp) { return(level.id > mPpassDifficeExp); } return(true); }
public bool IsCanBlitz(Hotfix_LT.Data.SpecialActivityLevelTemplate level, ResourceInstanceType type) { if (type == ResourceInstanceType.Gold) { return(level.id <= (mPassDifficeGlod - 1)); } else if (type == ResourceInstanceType.Exp) { return(level.id <= (mPpassDifficeExp - 1)); } return(false); }
private void OnItemSelect() { int index = ItemList.IndexOf(curObj); mChooseLevel = mlevelsTbl[index]; for (var i = 0; i < ItemList.Count; i++) { var item = ItemList[i]; item.transform.localScale = new Vector3(1f, 1f, 1f); item.GetComponent <UIWidget>().alpha = 0.75f; } curObj.GetComponent <UIWidget>().alpha = 1f; curObj.transform.localScale = new Vector3(1.45f, 1.45f, 1.45f); LevelDescLabel.text = mChooseLevel.name; LevelNumLabel.text = mChooseLevel.gold.ToString(); UpdatePartnerList(); SetBtnState(); }
public override IEnumerator OnAddToStack() { FusionAudio.StartBGM(); //每次进入资源界面清空类型记录防止干扰 LTDrawCardLookupController.DrawType = DrawCardType.none; mChooseLevel = null; mActivityTbl = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivity(mActivityId); mlevelsTbl = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivityLevels(mActivityId); if (mInstanceType == ResourceInstanceType.Gold) { ExpFx.CustomSetActive(false); GoldFx.CustomSetActive(true); } else if (mInstanceType == ResourceInstanceType.Exp) { GoldFx.CustomSetActive(false); ExpFx.CustomSetActive(true); } if (mActivityTbl == null || mlevelsTbl.Count < 0) { yield break; } InitUI(); CenterOnChild.onCenter += OnCenter; GlobalMenuManager.Instance.PushCache("LTResourceInstanceUI", (mActivityId == 9001) ? "Gold" : "Exp"); LTResourceInstanceManager.Instance.GetResourceInstanceTime(mActivityId, delegate { InitSelect(); }); yield return(null); yield return(base.OnAddToStack()); InitSelect();//start后執行一次,防止网络卡顿造成界面异常 }
public bool IsLevelEnough(Hotfix_LT.Data.SpecialActivityLevelTemplate level) { return(BalanceResourceUtil.GetUserLevel() >= level.level); }
private void SetTextInfo() { ArrayList rewardData; DataLookupsCache.Instance.SearchDataByID <ArrayList>("combat.rewards", out rewardData); Hashtable rewardDataTable; if (rewardData != null) { rewardDataTable = rewardData[0] as Hashtable; } else { rewardDataTable = Johny.HashtablePool.Claim(); } float percentValue = 0; if (BattleType == eBattleType.TreasuryBattle) { rewardDataTable = EB.Dot.Object("gold", rewardDataTable, null); int num = (int)EB.Dot.Single("quantity", rewardDataTable, 0); float percent = EB.Dot.Single("percent", rewardDataTable, 0); int damage = (int)EB.Dot.Single("damage", rewardDataTable, 0); int id = (int)EB.Dot.Single("currentDifficulty", rewardDataTable, 0); float mul = EB.Dot.Single("mul", rewardDataTable, 1); Hotfix_LT.Data.SpecialActivityLevelTemplate temp = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivityLevel(id); NameLabel.text = temp != null ? temp.name : string.Empty; DamageLabel.text = string.Format("{0}({1})", damage, ((int)(percent * 100f)).ToString() + "%"); DamageDescLabel.text = EB.Localizer.GetString("ID_codefont_in_LTResourceInstanceRatingGM_3232"); string colorStr = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal; float resultValue = num * mul; RewardLabel.text = string.Format("[{0}]+{1}", colorStr, (int)resultValue); GoldSprite.gameObject.CustomSetActive(true); ExpSprite.gameObject.CustomSetActive(false); percentValue = VIPTemplateManager.Instance.GetVIPPercent(VIPPrivilegeKey.TreasureRating, false); } else if (BattleType == eBattleType.ExpSpringBattle) { int num = (int)EB.Dot.Single("exp", rewardDataTable, 0); int killNum = (int)EB.Dot.Single("defeatMonsterNum", rewardDataTable, 0); int fullNum = (int)EB.Dot.Single("totalMonsterNum", rewardDataTable, 0); int id = (int)EB.Dot.Single("currentDifficulty", rewardDataTable, 0); float mul = EB.Dot.Single("mul", rewardDataTable, 1); Hotfix_LT.Data.SpecialActivityLevelTemplate temp = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivityLevel(id); NameLabel.text = temp != null ? temp.name : string.Empty; DamageLabel.text = string.Format("{0}/{1}", killNum, fullNum); DamageDescLabel.text = EB.Localizer.GetString("ID_codefont_in_LTResourceInstanceRatingGM_4117"); string colorStr = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal; float resultValue = num * mul; RewardLabel.text = string.Format("[{0}]+{1}", colorStr, (int)resultValue); GoldSprite.gameObject.CustomSetActive(false); ExpSprite.gameObject.CustomSetActive(true); percentValue = VIPTemplateManager.Instance.GetVIPPercent(VIPPrivilegeKey.ExpSpringRating, false); } PrivilegeAdditionLabel.gameObject.CustomSetActive(percentValue > 0); PrivilegeAdditionLabel.text = string.Format("{0} +{1}%", EB.Localizer.GetString("ID_CHARGE_VIP_WORD"), percentValue * 100); }