forked from zxl/LaboratoryProtection
28 lines
525 B
C#
28 lines
525 B
C#
using System;
|
|
using UnityEngine.UI;
|
|
|
|
namespace UnityTest.ZXL
|
|
{
|
|
public class GasDetectorUI : UI
|
|
{
|
|
public Button button;
|
|
private Action _action;
|
|
|
|
public override void OnInit()
|
|
{
|
|
base.OnInit();
|
|
button.onClick.AddListener(ClickEnter);
|
|
}
|
|
|
|
public void SetAction(Action action)
|
|
{
|
|
_action = action;
|
|
}
|
|
|
|
private void ClickEnter()
|
|
{
|
|
_action?.Invoke();
|
|
_action = null;
|
|
}
|
|
}
|
|
} |