Files
MinFt/Client/Assets/Scripts/UI/Rod/attributes_tips.cs
Liubing\LB 3d8d4d18f3 first commit
先修复一下,错误的场景

删除不必要的钓场资产

修复into场景

update:更新meta文件,修复报错

update:修复资源

修复第一章节建造

修复建造第三章

update:删除多余内容

update:更新README.md

update:还原图标

update:更新README

update:更新配置
2026-04-28 02:17:22 +08:00

75 lines
2.8 KiB
C#

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<Tables>();
var playerFishData = GContext.container.Resolve<PlayerFishData>();
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);
}
}