Health/Assets/Scripts/UI/Component/PanelItemManager.cs

33 lines
1.0 KiB
C#
Raw Normal View History

2023-11-20 15:10:51 +00:00
using TMPro;
using UnityEngine;
2023-11-27 18:00:13 +00:00
using UnityEngine.UI;
2023-11-20 15:10:51 +00:00
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>();
2023-11-27 18:00:13 +00:00
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);
2023-11-20 15:10:51 +00:00
}
}