29 lines
597 B
C#
29 lines
597 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
|
|
public class PopupManager : MonoBehaviour
|
|
{
|
|
public GameObject popupPanel;
|
|
public Image iconDisplay;
|
|
public TextMeshProUGUI titleText;
|
|
public TextMeshProUGUI infoText;
|
|
|
|
void Start()
|
|
{
|
|
popupPanel.SetActive(false);
|
|
}
|
|
|
|
public void OpenPopup(string title, string info, Sprite icon)
|
|
{
|
|
titleText.text = title;
|
|
infoText.text = info;
|
|
iconDisplay.sprite = icon;
|
|
popupPanel.SetActive(true);
|
|
}
|
|
|
|
public void ClosePopup()
|
|
{
|
|
popupPanel.SetActive(false);
|
|
}
|
|
} |