Health/Assets/_VoiceAssistant/Plugins/com.richframe.frame/Test/EventManagerTest.cs

33 lines
699 B
C#

using RichFrame.Event;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EventManagerTest : MonoBehaviour
{
private void Awake()
{
EventManager.Instance.ListenEvent<int,string>("a", Process);
}
// Start is called before the first frame update
void Start()
{
EventManager.Instance.ExecuteEvent("a", 5, "hahaha");
EventManager.Instance.RemoveListener<int, string>("a", Process);
EventManager.Instance.ExecuteEvent("a", 5, "hahaha2");
}
// Update is called once per frame
void Update()
{
}
void Process(int a, string b)
{
Debug.Log(a + ":" + b);
}
}