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
|
|
|
|
|
{
|
2023-09-18 00:01:05 +08:00
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-18 00:01:05 +08:00
|
|
|
|
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-09-13 15:04:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|