44 lines
924 B
C#
44 lines
924 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TEngine;
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
namespace GameLogic
|
|
{
|
|
[Window(UILayer.UI)]
|
|
class UIPlayerHeadItem : UIWidget
|
|
{
|
|
#region 脚本工具生成的代码
|
|
private Image m_imgHeadIcon;
|
|
protected override void ScriptGenerator()
|
|
{
|
|
m_imgHeadIcon = FindChildComponent<Image>("Mask/m_imgHeadIcon");
|
|
}
|
|
#endregion
|
|
|
|
#region 事件
|
|
#endregion
|
|
|
|
|
|
protected override void OnCreate()
|
|
{
|
|
base.OnCreate();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
public void OnInit(UnitPlayerData playerData, bool isDestroy = false)
|
|
{
|
|
// 设置头像
|
|
AsyncImageDownload.Instance.SetAsyncImage(playerData.protCustMessageData.imgURL, m_imgHeadIcon);
|
|
|
|
if (isDestroy)
|
|
{
|
|
UniTask.Delay(5000).ContinueWith(() => { Destroy(); });
|
|
}
|
|
}
|
|
}
|
|
}
|