Skip to content

Instantly share code, notes, and snippets.

@chuwilliamson
Created February 7, 2018 21:05
Show Gist options
  • Save chuwilliamson/003c497b623527eab4499ae9acff5a42 to your computer and use it in GitHub Desktop.
Save chuwilliamson/003c497b623527eab4499ae9acff5a42 to your computer and use it in GitHub Desktop.
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