Created
November 28, 2017 23:24
-
-
Save theWill/9a8e1736f2c04daba0fbee8f5934ab9f 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 UnityEngine; | |
using UnityEngine.Events; | |
namespace faunlily | |
{ | |
public class GameEventListener : MonoBehaviour | |
{ | |
public GameEvent Event; | |
public UnityEvent Response; | |
private void OnEnable() | |
{ | |
Event.RegisterListener(this); | |
} | |
private void OnDisable() | |
{ | |
Event.UnregisterListener(this); | |
} | |
public void OnEventRaised() | |
{ | |
//Debug.Log("event raised on " + this.name); | |
Response.Invoke(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment