51 lines
1.2 KiB
C#
Raw Normal View History

2025-04-18 19:18:15 +08:00
using UnityEngine;
using UnityEngine.UI;
using TEngine;
using Cysharp.Threading.Tasks;
namespace GameLogic
{
[Window(UILayer.UI)]
class UIVipItem : UIWindow
{
#region
private Image m_img_Icon;
private Text m_text_Name;
private Text m_text_topRank;
protected override void ScriptGenerator()
{
m_img_Icon = FindChildComponent<Image>("HeadItem/m_img_Icon");
m_text_Name = FindChildComponent<Text>("m_text_Name");
m_text_topRank = FindChildComponent<Text>("m_text_topRank");
}
#endregion
#region
#endregion
protected async override void OnCreate()
{
base.OnCreate();
VipItemData giftItemData = UserData as VipItemData;
if (giftItemData == null)
{
GameModule.UI.CloseUI<UIVipItem>();
return;
}
if (giftItemData.m_ProtCustMessageData.imgURL != string.Empty)
{
AsyncImageDownload.Instance.SetAsyncImage(giftItemData.m_ProtCustMessageData.imgURL, m_img_Icon);
}
m_text_Name.text = UITool.ConvertName(giftItemData.m_ProtCustMessageData.nickName);
m_text_topRank.text = giftItemData.m_RankNum.ToString();
await UniTask.Delay(4000);
GameModule.UI.CloseUI<UIVipItem>();
}
}
}