LaboratoryProtection/Assets/UnityTest/ZXL/Scripts/UI/SureButton.cs

40 lines
890 B
C#
Raw Normal View History

2023-10-05 13:49:55 +08:00
using System;
using Mono.Event;
using UnityEngine;
using UnityEngine.UI;
namespace UnityTest.ZXL
{
public class SureButton : MonoBehaviour
{
[SerializeField] private Button _button;
[SerializeField] private SureButtonType _sureButtonType;
public SureButtonType sureButtonType => _sureButtonType;
private void Awake()
{
_button = GetComponent<Button>();
_button.onClick.AddListener(Click);
}
private void OnDestroy()
{
_button.onClick.RemoveListener(Click);
}
void Click()
{
EventManager.Instance.FireNow(this, new SureButtonEventArgs(this));
}
}
public enum SureButtonType
{
None,
,
,
,
,
}
}