Created
February 7, 2018 21:05
-
-
Save chuwilliamson/003c497b623527eab4499ae9acff5a42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
public class GameEventArgsListener : MonoBehaviour | |
{ | |
public GameEventArgs Event; | |
public Object Sender; | |
public GameEventArgsResponse Response; | |
private void OnEnable() | |
{ | |
Event.RegisterListener(this); | |
} | |
private void OnDisable() | |
{ | |
Event.UnregisterListener(this); | |
} | |
public void OnEventRaised(Object[] args) | |
{ | |
if (Sender == null || Sender == args[0]) | |
Response.Invoke(args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment