41 lines
894 B
C#
41 lines
894 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Uis
|
|
{
|
|
public class InteractionUi : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private GameObject _panel;
|
|
|
|
[SerializeField]
|
|
private TMP_Text _keyText;
|
|
|
|
[SerializeField]
|
|
private TMP_Text _interactionText;
|
|
|
|
private void Start()
|
|
{
|
|
EventManager.OnShowInteractionUi += ShowUi;
|
|
EventManager.OnHideInteractionUi += HideUi;
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
EventManager.OnShowInteractionUi -= ShowUi;
|
|
EventManager.OnHideInteractionUi -= HideUi;
|
|
}
|
|
|
|
public void ShowUi(string message)
|
|
{
|
|
_interactionText.text = message;
|
|
_panel.SetActive(true);
|
|
}
|
|
|
|
public void HideUi()
|
|
{
|
|
_panel.SetActive(false);
|
|
}
|
|
}
|
|
}
|