Created
February 15, 2020 19:00
-
-
Save wowbroforce/8c7c5f6b27cbed21e4e512697741b1c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Events; | |
public class GameEventListener : MonoBehaviour | |
{ | |
public GameEvent @event; | |
public UnityEvent response; | |
private void OnEnable() | |
{ | |
@event.Register(listener: this); | |
} | |
private void OnDisable() | |
{ | |
@event.Unregister(listener: this); | |
} | |
public void OnEventRised() | |
{ | |
response.Invoke(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment