GamePassEvent.cs 432 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class GamePassEvent : MonoBehaviour
  6. {
  7. public static Action mOnEvent;
  8. public static void Register(Action onEvent)
  9. {
  10. mOnEvent += onEvent;
  11. }
  12. public static void UnRegister(Action onEvent)
  13. {
  14. mOnEvent -= onEvent;
  15. }
  16. public static void Trigger()
  17. {
  18. mOnEvent?.Invoke();
  19. }
  20. }