Files
ft/Client/Assets/Scripts/Event1v1Battle/Panel/InfoPanel/Event1v1BattleSlapInfoCell.cs
2026-06-29 21:18:33 +08:00

36 lines
1.0 KiB
C#

using System;
using asap.core;
using cfg;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using GameCore;
namespace Event1v1Battle.Panel.InfoPanel
{
public class Event1v1BattleSlapInfoCell:MonoBehaviour
{
private TMP_Text text_info;
private Image icon;
private void Awake()
{
text_info = gameObject.FindChildGameObject("text_info").GetComponent<TMP_Text>();
icon = gameObject.FindChildGameObject("icon").GetComponent<Image>();
}
public async void SetData(EventSlapSpinach data)
{
try
{
text_info.text = LocalizationMgr.GetFormatTextValue("UI_Event1v1BattleSlapPanel_12",1);
var iconName = GContext.container.Resolve<Tables>()?.GetItemIconName(data.FishItemID);
await GContext.container.Resolve<IUIService>().SetImageSprite(icon, iconName);
}
catch (Exception e)
{
Debug.LogError(e);
}
}
}
}