48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
![]() |
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using Cysharp.Threading.Tasks;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
using DG.Tweening;
|
||
|
|
||
|
namespace GameLogic
|
||
|
{
|
||
|
public class UIJiaRuItem : MonoBehaviour
|
||
|
{
|
||
|
private Text m_Name;
|
||
|
private Text m_Info;
|
||
|
private GameObject m_Run;
|
||
|
void Awake()
|
||
|
{
|
||
|
m_Name = transform.Find("Name").GetComponent<Text>();
|
||
|
m_Info = transform.Find("Info").GetComponent<Text>();
|
||
|
m_Run = transform.Find("Run").gameObject;
|
||
|
}
|
||
|
|
||
|
public void OnInit(UnitPlayerData unitPlayerData)
|
||
|
{
|
||
|
m_Name.text = unitPlayerData.protCustMessageData.nickName;
|
||
|
m_Run.transform.DOLocalMoveX(78, 1f);
|
||
|
if (EventConts.gameStateType == GameStateType.个人赛)
|
||
|
{
|
||
|
m_Info.text = "加入玩法";
|
||
|
}
|
||
|
else if (EventConts.gameStateType == GameStateType.团队赛)
|
||
|
{
|
||
|
m_Info.text = "加入" + DataGameSceneManager.Instance.GetStrs((int.Parse(unitPlayerData.teamId)));
|
||
|
}
|
||
|
|
||
|
transform.DOLocalMoveX(42, 0.25f).SetEase(Ease.Linear).OnComplete(async () =>
|
||
|
{
|
||
|
await UniTask.Delay(2500);
|
||
|
if (this != null && this.gameObject != null && transform.parent != null)
|
||
|
{
|
||
|
Destroy(gameObject);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|