36 lines
795 B
C#
36 lines
795 B
C#
using Base;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
|
|
namespace UI
|
|
{
|
|
|
|
public delegate void NonReturnCallback();
|
|
public class EntityPlacementUI:UIBase,ITickUI
|
|
{
|
|
public TMP_Text promptText;
|
|
|
|
public NonReturnCallback currentAction;
|
|
|
|
public string Prompt
|
|
{
|
|
get => promptText.text;
|
|
set => promptText.text = value;
|
|
}
|
|
public void TickUI()
|
|
{
|
|
if (!IsVisible)
|
|
return;
|
|
if (Input.GetKeyDown(KeyCode.Escape))
|
|
{
|
|
Base.UIInputControl.Instance.Hide(this);
|
|
}
|
|
if (currentAction!=null&&Input.GetMouseButtonDown(0))
|
|
{
|
|
currentAction();
|
|
}
|
|
}
|
|
|
|
}
|
|
} |