| | |
| | |
|
| | | if (!isMax)
|
| | | {
|
| | | AutoSelectPotentialBook();
|
| | | DisplayUpgradeCost();
|
| | | DisplayGetSkill();
|
| | | DisplaySuccessRatio();
|
| | |
| | | var isMax = level >= config.SkillMaxLV;
|
| | | if (!isMax)
|
| | | {
|
| | | DisplayPotentialBook(0);
|
| | | AutoSelectPotentialBook();
|
| | | DisplayPotentialBook(model.selectedPotentialBook);
|
| | | }
|
| | |
|
| | | model.onPotentialLevelUpResultEvent -= OnPotentialLevelUp;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | void AutoSelectPotentialBook()
|
| | | {
|
| | | var potential = m_Treasure.GetPotential(model.selectedPotential);
|
| | | if (potential == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var levelUpType = model.GetSkillLevelUpType(potential.id);
|
| | | var levelupId = TreasureModel.GetSkillLevelUpId(levelUpType, potential.level + 1);
|
| | | var config = Config.Instance.Get<TreasureSkillConfig>(levelupId);
|
| | | if (config == null)
|
| | | {
|
| | | 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 rate = config.Rate[0];
|
| | | if (rate >= 60 && own >= need)
|
| | | {
|
| | | model.selectedPotentialBook = itemId;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayUpgradeCost()
|
| | | {
|
| | | var potential = m_Treasure.GetPotential(selectedPotential);
|