40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ChatCard : CardBase
|
|
{
|
|
public Image sprite_face, sprite_msgbg;
|
|
public TextMeshProUGUI label_rankname, label_msg;
|
|
|
|
string PlayfabID;
|
|
|
|
// 타입(0) | 플레이팹ID(1) | 얼굴아이콘(2) | 칭호와 이름(3) | 메시지(4)
|
|
public void Set(string[] _split)
|
|
{
|
|
base.Set();
|
|
int.TryParse(_split[2], out int num);
|
|
if (num < 10101) num = 10101;
|
|
PlayfabID = _split[1];
|
|
sprite_face.sprite = UIAtlasMgr.Ins.Get_Sprite(table_itemlist.Ins.Get_Data(num).s_ItemIcon);
|
|
sprite_msgbg.color = ServerInfo.Ins.m_LoginInfo.PlayFabId.Equals(PlayfabID) ? new Color32(255, 235, 123, 255) : Color.white;
|
|
label_rankname.text = _split[3];
|
|
label_msg.text = _split[4];
|
|
|
|
transform.localPosition = Vector3.down;
|
|
}
|
|
|
|
public void OnClick_ChatCard()
|
|
{
|
|
if (!ServerInfo.Ins.m_LoginInfo.PlayFabId.Equals(PlayfabID))
|
|
{
|
|
Popup.Ins.Set(ePopupType.Two, 101,
|
|
() =>
|
|
{
|
|
MessageInfo.Ins.m_ChatUI.Add_ChatBan(new ChatBanData { ID = PlayfabID, Nick = label_rankname.text });
|
|
}, null, label_rankname.text);
|
|
}
|
|
}
|
|
} |