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

41 lines
924 B
C#

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,
,
,
,
,
,
}
}