62 lines
1.4 KiB
C#
62 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class TitleGetUI : MonoBehaviourSingletonTemplate<TitleGetUI>
|
|
{
|
|
public GameObject m_go;
|
|
public Animator m_Anim;
|
|
public TextMeshProUGUI[] labels; // 0 칭호, 1 설명
|
|
|
|
public static List<int> list_gettitle = new List<int>();
|
|
List<int> list_reserv = new List<int>();
|
|
int tick;
|
|
|
|
public void Set(int titleid)
|
|
{
|
|
list_gettitle.Add(titleid);
|
|
|
|
if (!m_go.activeSelf)
|
|
{
|
|
m_go.SetActive(true);
|
|
|
|
var tdata = table_title.Ins.Get_Data(titleid);
|
|
labels[0].text = DSUtil.Format("{0}[{1}]", MyValue.Get_GradeColor((int)tdata.Grade), tdata.Name);
|
|
labels[1].text = tdata.Desc;
|
|
|
|
m_Anim.Play("RightToLeft");
|
|
tick = 300;
|
|
}
|
|
else
|
|
list_reserv.Add(titleid);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (tick > 0)
|
|
{
|
|
--tick;
|
|
if (tick <= 0)
|
|
StartCoroutine(Co_AnimOut());
|
|
}
|
|
}
|
|
|
|
public void OnClick_Close()
|
|
{
|
|
if (tick > 0)
|
|
tick = 1;
|
|
}
|
|
|
|
IEnumerator Co_AnimOut()
|
|
{
|
|
m_Anim.Play("LeftToRight");
|
|
yield return new WaitForSeconds(2f);
|
|
m_go.SetActive(false);
|
|
if (list_reserv.Count > 0)
|
|
{
|
|
Set(list_reserv[0]);
|
|
list_reserv.RemoveAt(0);
|
|
}
|
|
}
|
|
} |