33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class PanelItemManager : MonoBehaviour
|
|
{
|
|
public TMP_Text Title;
|
|
public TMP_Text Description;
|
|
|
|
private void Awake()
|
|
{
|
|
Title = transform.Find("Title").GetComponent<TMP_Text>();
|
|
Description = transform.Find("Description").GetComponent<TMP_Text>();
|
|
transform.Find("Lock").gameObject.SetActive(false);
|
|
transform.Find("background").GetComponent<Image>().color = new Color(1, 1, 1, 1);
|
|
Description.gameObject.SetActive(true);
|
|
}
|
|
|
|
public void Lock()
|
|
{
|
|
transform.Find("Lock").gameObject.SetActive(true);
|
|
transform.Find("background").GetComponent<Image>().color = new Color(0.5f, 0.5f, 0.5f, 0.5f);
|
|
Description.gameObject.SetActive(false);
|
|
}
|
|
|
|
public void UnLock()
|
|
{
|
|
transform.Find("Lock").gameObject.SetActive(false);
|
|
transform.Find("background").GetComponent<Image>().color = new Color(1, 1, 1, 1);
|
|
Description.gameObject.SetActive(true);
|
|
}
|
|
}
|