Files
back_cantanBuilding/Assets/Scripts/UI/Challenge/EventChallengeInfoPopupPanel.cs
2026-05-26 16:15:54 +08:00

69 lines
2.3 KiB
C#

using System.Linq;
using asap.core;
using GameCore;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class EventChallengeInfoPopupPanel : MonoBehaviour
{
private TMP_Text _textTitle;
// 数量文字
private TMP_Text _info1_item1_text_num;
private TMP_Text _info1_item2_text_num;
private TMP_Text _info1_item3_text_num;
// 信息
private TMP_Text _info1_text_info;
private TMP_Text _info2_text_info;
private TMP_Text _info3_text_info;
//
private TMP_Text _info3TotalPrizeTextNum;
//
private TMP_Text _textTips;
// public RewardItemNew[] rewardItemNews1;
// public TMP_Text text_title2;
// public RewardItemNew[] rewardItemNews2;
private FishingChallengeManager _fishingChallengeManager;
private void Awake()
{
//
_textTitle = transform.Find("root/text_title").GetComponent<TMP_Text>();
_info1_item1_text_num = transform.Find("root/info1/item/item1/text_num").GetComponent<TMP_Text>();
_info1_item2_text_num = transform.Find("root/info1/item/item2/text_num").GetComponent<TMP_Text>();
_info1_item3_text_num = transform.Find("root/info1/item/item3/text_num").GetComponent<TMP_Text>();
//
_info1_text_info = transform.Find("root/info1/text_info").GetComponent<TMP_Text>();
_info2_text_info = transform.Find("root/info2/text_info").GetComponent<TMP_Text>();
_info3_text_info = transform.Find("root/info3/text_info").GetComponent<TMP_Text>();
//
_info3TotalPrizeTextNum = transform.Find("root/info3/total_prize/reward/text_num").GetComponent<TMP_Text>();
_fishingChallengeManager = GContext.container.Resolve<FishingChallengeManager>();
}
private void Start()
{
//
_info1_item1_text_num.text = "x" + _fishingChallengeManager.GetQualityScore(3);
_info1_item2_text_num.text = "x" + _fishingChallengeManager.GetQualityScore(4);
_info1_item3_text_num.text = "x" + _fishingChallengeManager.GetQualityScore(5);
var itemData = _fishingChallengeManager.GetFinalReward().FirstOrDefault();
if (itemData?.count > 0)
{
_info3TotalPrizeTextNum.text = "x" + ConvertTools.GetNumberString(itemData.count);
}
}
}