51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
![]() |
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>();
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|