You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lanlib/Samples/EventManager/TestSubscribeEvent.cs

28 lines
557 B
C#

using System;
using UnityEngine;
using EVM = LanLib.EventManager;
namespace Samples.EventManager
{
public struct TestEvent
{
}
public class TestSubscribeEvent : MonoBehaviour
{
private void Awake()
{
EVM.EventManager.Instance.Subscribe<TestEvent>(OnTest);
}
private void OnDestroy()
{
EVM.EventManager.Instance.Unsubscribe<TestEvent>(OnTest);
}
private void OnTest(TestEvent evt)
{
print("TestEvent trigger!!!");
}
}
}