LaboratoryProtection/Assets/UnityTest/ZXL/Scripts/FireEvent.cs

63 lines
1.7 KiB
C#
Raw Normal View History

2023-09-14 15:36:17 +08:00
using System;
using Mono.Event;
2023-09-13 15:04:19 +08:00
using UnityEngine;
namespace UnityTest.ZXL
{
public class FireEvent : MonoBehaviour
{
public void FireConstEvent(string str)
2023-09-13 15:04:19 +08:00
{
2023-09-14 15:36:17 +08:00
if (!Enum.TryParse(str, out ConstDataType dataType))
{
Debug.LogError("str转枚举失败");
}
EventManager.Instance.FireNow(this, new ConstEventArgs(dataType));
}
public void FireConstEvent(ConstData constData)
{
// if (!Enum.TryParse(str, out ConstDataType dataType))
// {
// Debug.LogError("str转枚举失败");
// }
EventManager.Instance.FireNow(this, new ConstEventArgs(constData.ConstDataType));
}
public void FireConstEvent(ConstDataType constData)
{
// if (!Enum.TryParse(str, out ConstDataType dataType))
// {
// Debug.LogError("str转枚举失败");
// }
EventManager.Instance.FireNow(this, new ConstEventArgs(constData));
}
2023-09-14 15:36:17 +08:00
public void OpenTipsUI(string str)
{
2023-09-13 15:04:19 +08:00
}
2023-09-27 23:28:03 +08:00
public void PlayAudio(string str)
{
2023-10-05 02:31:29 +08:00
EventManager.Instance.FireNow(this, new AudioEventArgs(str));
}
public void OpenEffect(string str)
{
EventManager.Instance.FireNow(this, new EffectEventArgs(str, true));
}
public void CloseEffect(string str)
{
EventManager.Instance.FireNow(this, new EffectEventArgs(str, false));
2023-09-27 23:28:03 +08:00
}
2023-10-05 13:49:55 +08:00
public void ClickSureButton(SureButton sender)
{
EventManager.Instance.FireNow(this, new SureButtonEventArgs(sender));
}
2023-09-13 15:04:19 +08:00
}
}