先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class StatisticItem : MonoBehaviour
|
|
{
|
|
public Button button;
|
|
public Image icon;
|
|
public TMP_Text text_title;
|
|
public TMP_Text text_num;
|
|
public GameObject text_none;
|
|
public GameObject redpoints;
|
|
private void Reset()
|
|
{
|
|
button = transform.Find("btn_green").GetComponent<Button>();
|
|
icon = transform.Find("btn_green/icon").GetComponent<Image>();
|
|
text_title = transform.Find("btn_green/text_title").GetComponent<TMP_Text>();
|
|
text_num = transform.Find("btn_green/text_num").GetComponent<TMP_Text>();
|
|
text_none = transform.Find("btn_green/text_none").gameObject;
|
|
redpoints = transform.Find("btn_green/redpoints").gameObject;
|
|
}
|
|
public void Init(Statistics statistics)
|
|
{
|
|
text_title.text = LocalizationMgr.GetFormatTextValue(statistics.Text_l10n_key);
|
|
IUIService uiService = GContext.container.Resolve<IUIService>();
|
|
uiService.SetImageSprite(icon, statistics.Icon);
|
|
AchievementDataManager achievementDataManager = GContext.container.Resolve<AchievementDataManager>();
|
|
ulong num = achievementDataManager.GetAchievementDatas(statistics.ConditionType);
|
|
text_none.SetActive(num == 0);
|
|
text_num.gameObject.SetActive(num > 0);
|
|
if (num > 0)
|
|
{
|
|
if (ConditionType.GetFishWeight == statistics.ConditionType)
|
|
{
|
|
double fishWeight = num / 1000;
|
|
text_num.text = LocalizationMgr.GetWeight(fishWeight);
|
|
}
|
|
else
|
|
{
|
|
text_num.text = ConvertTools.GetNumberString(num);
|
|
}
|
|
}
|
|
}
|
|
}
|