| | |
| | | {
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | m_SuccessRatio.text = StringUtility.Contact((levelUpConfig.rate * 0.01f).ToString("f0"), "%");
|
| | | m_RatioUp.gameObject.SetActive(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0);
|
| | | 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;
|
| | |
| | | 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)
|
| | | {
|
| | |
| | | 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();
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | 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]
|