Added basic popup action menu
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ItemActionsUI : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private TextMeshProUGUI _title;
|
||||
[SerializeField]
|
||||
private TextMeshProUGUI _description;
|
||||
|
||||
[SerializeField]
|
||||
private Button _btnCancel;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
public void Show(string title, string description)
|
||||
{
|
||||
_title.text = title;
|
||||
_description.text = description;
|
||||
|
||||
_btnCancel.onClick.AddListener(() =>
|
||||
{
|
||||
Hide();
|
||||
});
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
private void Hide()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
//Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user