first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace OTGIntegrated.UI
|
||||
{
|
||||
public sealed class InteractionPromptUI : MonoBehaviour
|
||||
{
|
||||
public GameObject root;
|
||||
public Text promptText;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (root == null)
|
||||
{
|
||||
root = gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
public void Show(string prompt)
|
||||
{
|
||||
if (root != null)
|
||||
{
|
||||
root.SetActive(true);
|
||||
}
|
||||
|
||||
if (promptText != null)
|
||||
{
|
||||
promptText.text = prompt;
|
||||
}
|
||||
}
|
||||
|
||||
public void Hide()
|
||||
{
|
||||
if (root != null)
|
||||
{
|
||||
root.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user