| | |
| | | var level = potential.level;
|
| | | var isMax = level >= config.SkillMaxLV;
|
| | | m_PotentialMaxLevelTip.gameObject.SetActive(isMax);
|
| | | m_ContainerUpgrade.gameObject.SetActive(!isMax && FuncOpen.Instance.IsFuncOpen(82));
|
| | | m_ContainerUpgrade.gameObject.SetActive(!isMax &&
|
| | | FuncOpen.Instance.IsFuncOpen(82) && model.IsPotentialUnlock(m_Treasure.id, selectedPotential));
|
| | | m_ContainerRequirement.gameObject.SetActive(!isMax);
|
| | |
|
| | | if (!isMax)
|
| | |
| | | DisplayUpgradeCost();
|
| | | DisplayGetSkill();
|
| | | DisplaySuccessRatio();
|
| | | m_UpgradeImage.gray = !TestPotentialLevelUp();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (config.InitialRate >= 100)
|
| | | {
|
| | | model.selectedPotentialBook = 0;
|
| | | return;
|
| | | }
|
| | | var itemId = config.Meterial2ID.Length > 0 ? config.Meterial2ID[0] : 0;
|
| | | if (itemId != 0)
|
| | | {
|
| | | var own = playerPack.GetItemCountByID(PackType.rptItem, itemId);
|
| | | var need = config.MeterialNum2[0];
|
| | | //var own = playerPack.GetItemCountByID(PackType.rptItem, itemId);
|
| | | //var need = config.MeterialNum2[0];
|
| | | var rate = config.Rate[0];
|
| | | if (rate >= 60 && own >= need)
|
| | | if (rate >= 60)
|
| | | {
|
| | | model.selectedPotentialBook = itemId;
|
| | | }
|
| | |
| | | m_SPOwn.text = UIHelper.ReplaceLargeNum(spOwn);
|
| | | m_SPNeed.text = StringUtility.Contact("/", UIHelper.ReplaceLargeNum(spNeed));
|
| | | m_SPOwn.color = spOwn >= spNeed ? UIHelper.GetUIColor(TextColType.DarkGreen) : UIHelper.GetUIColor(TextColType.Red);
|
| | | m_UpgradeImage.gray = spOwn < spNeed;
|
| | | }
|
| | |
|
| | | private void DisplayGetSkill(bool _levelUp = false)
|
| | |
| | | {
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | m_SuccessRatio.text = StringUtility.Contact((levelUpConfig.rate * 0.01f).ToString("f0"), "%");
|
| | | m_RatioUp.gameObject.SetActive(model.selectedPotentialBook != 0);
|
| | | m_SuccessRatio.color = UIHelper.GetUIColor(model.selectedPotentialBook != 0 ? TextColType.DarkGreen : TextColType.LightYellow);
|
| | | m_UpgradeImage.gray = !TestPotentialLevelUp();
|
| | | m_RatioUp.gameObject.SetActive(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0 && levelUpConfig.materilaKind > 1);
|
| | | m_SuccessRatio.color = UIHelper.GetUIColor(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0
|
| | | ? TextColType.DarkGreen : TextColType.LightYellow);
|
| | | m_UpgradeImage.gray = levelUpConfig.rate == 0 && model.selectedPotentialBook == 0;
|
| | | m_Upgrade.interactable = levelUpConfig.rate != 0 || model.selectedPotentialBook != 0;
|
| | | }
|
| | |
|
| | | private void DisplayAddBookRedpoint()
|
| | |
| | | private void OnSpNeedItem()
|
| | | {
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | if (levelUpConfig.rate < 10000 || model.selectedPotentialBook != 0)
|
| | | if (levelUpConfig.rate >= 10000)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("SPSuccessHint");
|
| | | return;
|
| | | }
|
| | | if (model.selectedPotentialBook == 0)
|
| | | {
|
| | | WindowCenter.Instance.Open<PotentialItemUseWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("SPSuccessHint");
|
| | | //DesignDebug.Log("成功率已经够高了,不需要再增加概率了!");
|
| | | if (levelUpConfig.materilaKind > 1)
|
| | | {
|
| | | WindowCenter.Instance.Open<PotentialItemUseWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(model.selectedPotentialBook);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_PotentialBook.gameObject.SetActive(_potentialBookId != 0);
|
| | | m_PotentialCount.gameObject.SetActive(_potentialBookId != 0);
|
| | | m_RemoveBook.gameObject.SetActive(_potentialBookId != 0);
|
| | | m_RemoveBook.gameObject.SetActive(false);
|
| | | m_AddBookSign.gameObject.SetActive(_potentialBookId == 0);
|
| | | if (_potentialBookId != 0)
|
| | | {
|
| | |
| | | m_PotentialBook.SetItem(_potentialBookId, 1);
|
| | |
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | m_PotentialCount.text = StringUtility.Contact(levelUpConfig.own, "/", levelUpConfig.need);
|
| | | bool satisfy = levelUpConfig.own >= levelUpConfig.need;
|
| | | m_PotentialCount.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(satisfy ?
|
| | | TextColType.LightYellow : TextColType.Red, levelUpConfig.own.ToString()), "/", levelUpConfig.need);
|
| | | m_RemoveBook.gameObject.SetActive(levelUpConfig.materilaKind > 1);
|
| | | }
|
| | |
|
| | | DisplaySuccessRatio();
|
| | |
| | | if (packType == PackType.rptItem && config != null && config.Type == 6)
|
| | | {
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | if (levelUpConfig.own < levelUpConfig.need)
|
| | | if (_id == model.selectedPotentialBook)
|
| | | {
|
| | | model.selectedPotentialBook = 0;
|
| | | DisplayPotentialBook(model.selectedPotentialBook);
|
| | | }
|
| | | //if (levelUpConfig.own < levelUpConfig.need)
|
| | | //{
|
| | | // model.selectedPotentialBook = 0;
|
| | | //}
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | break;
|
| | | case 3:
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("Hallows_SpUnEnough"));
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(148);
|
| | | //MessageWin.Inst.ShowFixedTip(Language.Get("Hallows_SpUnEnough"));
|
| | | break;
|
| | | case 4:
|
| | | SysNotifyMgr.Instance.ShowTip("TreasureUnsealed");
|
| | | break;
|
| | | case 6:
|
| | | SysNotifyMgr.Instance.ShowTip("LevelUpZeroRate");
|
| | | if (model.selectedPotentialBook != 0)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(model.selectedPotentialBook);
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LevelUpZeroRate");
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | |
| | | var config = Config.Instance.Get<TreasureSkillConfig>(levelupId);
|
| | | if (config == null)
|
| | | {
|
| | | return new PotentialLevelUpConfig(0, 0, 0, 0);
|
| | | return new PotentialLevelUpConfig(0, 0, 0, 0, 0);
|
| | | }
|
| | | if (model.selectedPotentialBook == 0)
|
| | | {
|
| | | return new PotentialLevelUpConfig(config.InitialRate, 0, 0, 0);
|
| | | return new PotentialLevelUpConfig(config.InitialRate, 0, 0, 0, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | var need = config.MeterialNum2[index];
|
| | | var ratio = own >= need ? config.Rate[index] : config.InitialRate;
|
| | |
|
| | | return new PotentialLevelUpConfig(ratio, index + 1, own, need);
|
| | | return new PotentialLevelUpConfig(ratio, index + 1, own, need, config.Meterial2ID.Length);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | if (levelUpConfig.own < levelUpConfig.need || !ContainsPotentialBook(model.selectedPotentialBook))
|
| | | if (!ContainsPotentialBook(model.selectedPotentialBook))
|
| | | {
|
| | | model.selectedPotentialBook = 0;
|
| | | AutoSelectPotentialBook();
|
| | | //model.selectedPotentialBook = 0;
|
| | | }
|
| | |
|
| | | var curconfig = Config.Instance.Get<SkillConfig>(potential.id);
|
| | |
| | | m_SPOwn.text = UIHelper.ReplaceLargeNum(spOwn);
|
| | | m_SPNeed.text = StringUtility.Contact("/", UIHelper.ReplaceLargeNum(spNeed));
|
| | | m_SPOwn.color = spOwn >= spNeed ? UIHelper.GetUIColor(TextColType.DarkGreen) : UIHelper.GetUIColor(TextColType.Red);
|
| | | m_UpgradeImage.gray = !TestPotentialLevelUp();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | public int rate;
|
| | | public int need;
|
| | | public int own;
|
| | | public int materilaKind;
|
| | |
|
| | | public PotentialLevelUpConfig(int _rate, int _materilaIndex, int _own, int _need)
|
| | | public PotentialLevelUpConfig(int _rate, int _materilaIndex, int _own, int _need,int materilaKind)
|
| | | {
|
| | | this.rate = _rate;
|
| | | this.materilaIndex = _materilaIndex;
|
| | | this.need = _need;
|
| | | this.own = _own;
|
| | | this.materilaKind = materilaKind;
|
| | | }
|
| | | }
|
| | | [Serializable]
|