using asap.core; using cfg; using GameCore; using TMPro; using UnityEngine; public class attributes_tips : MonoBehaviour { public TMP_Text text_name; public TMP_Text text_num; public TMP_Text basic_text; public TMP_Text level_text; public GameObject levelGo; public TMP_Text ascend_text; public GameObject ascendGo; public TMP_Text honorle_text; public GameObject honorleGo; public Transform arrow; public TMP_Text text_info1; public void Init(int index, RodData rodData) { var _tables = GContext.container.Resolve(); var playerFishData = GContext.container.Resolve(); RodAscend rodAscend = _tables.TbRodAscend.GetOrDefault(rodData.AscendID); RodLevelup rodLevelup = _tables.TbRodLevelup.GetOrDefault(rodData.LevelupID); int star = playerFishData.GetRodPiece(rodData.ID); int level = playerFishData.GetRodLevel(rodData.ID); int basicValue = rodData.InitialBasicStats[index]; basic_text.text = basicValue.ToString(); //等级对属性的加成 每个属性升到多少级 int levelValue = 0; var levelupBasicStats = rodLevelup.LevelupBasicStats; levelValue += levelupBasicStats[index][level]; level_text.text = levelValue.ToString(); levelGo.SetActive(levelValue > 0); //星级对属性的加成 某几个属性加多少加到多少星 int ascendValue = 0; var AscentBasicStats = rodAscend.AscentBasicStat; var AscentBasicStatList = rodAscend.AscentBasicStatList; for (int i = star - 1; i >= 0; i--) { var AscentBasicStat = AscentBasicStats[i]; int count = AscentBasicStat.Count; for (int j = 0; j < count; j++) { //InitialBasicStats 中第 AscentBasicStat[j] 个值加 i 星的值 累加 if (index == AscentBasicStat[j] - 1) { ascendValue = AscentBasicStatList[i][j]; break; } } if (ascendValue > 0) break; } this.ascend_text.text = ascendValue.ToString(); ascendGo.SetActive(ascendValue > 0); //星级对属性的加成 某几个属性加多少加到多少星 int honorValue = 0; if (index == 0) { honorValue = playerFishData.GetHonorLevelAttribute(rodData.Quality); } this.honorle_text.text = honorValue.ToString(); honorleGo.SetActive(honorValue > 0); var rodBasicStats = _tables.TbRodBasicStats.DataList; text_num.text = (basicValue + levelValue + ascendValue + honorValue).ToString(); text_name.text = LocalizationMgr.GetText(rodBasicStats[index].Title_l10n_key); text_info1.text = LocalizationMgr.GetText(_tables.TbRodBasicStats.DataList[index].Desc_l10n_key); } }