using System; using Mono.Event; using UnityEngine; namespace UnityTest.ZXL { public class FireEvent : MonoBehaviour { public void FireConstEvent(string str) { 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)); } public void OpenTipsUI(string str) { } public void PlayAudio(string str) { 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)); } } }