35 lines
923 B
C#
35 lines
923 B
C#
using GameCore;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class FeatureUnlockPreviewPopupPanel : MonoBehaviour
|
|
{
|
|
private Button btnClose;
|
|
private Button btn_confirm;
|
|
public GameObject[] panels;
|
|
private void Awake()
|
|
{
|
|
btnClose = transform.Find("btn_close").GetComponent<Button>();
|
|
btn_confirm = transform.Find("root/btn_confirm/btn_policy").GetComponent<Button>();
|
|
}
|
|
public void InitPanel(int index)
|
|
{
|
|
index--;
|
|
for (int i = 0; i < panels.Length; i++)
|
|
{
|
|
panels[i].SetActive(i == index);
|
|
}
|
|
panels[index].transform.Find("unlock/text_grade").GetComponent<TMP_Text>().text = "40";
|
|
}
|
|
private void Start()
|
|
{
|
|
btnClose.onClick.AddListener(Destroy);
|
|
btn_confirm.onClick.AddListener(Destroy);
|
|
}
|
|
void Destroy()
|
|
{
|
|
UIManager.Instance.DestroyUI(gameObject.name);
|
|
}
|
|
}
|