You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Source/Scripts/UpgradeUI.cs

35 lines
694 B
C#

using UnityEngine;
using UnityEngine.UI;
public class UpgradeUI : MonoBehaviour
{
[SerializeField] private CanvasGroup canvasGroup;
[SerializeField] private UpgradeButtonUI[] buttons;
private void Awake()
{
HideUI();
}
public UpgradeButtonUI[] GetButtons()
{
return buttons;
}
public void ShowUI()
{
canvasGroup.alpha = 1;
canvasGroup.blocksRaycasts = true;
canvasGroup.interactable = true;
Time.timeScale = 0;
}
public void HideUI()
{
canvasGroup.alpha = 0;
canvasGroup.blocksRaycasts = false;
canvasGroup.interactable = false;
Time.timeScale = 1;
}
}