Skip to content

Instantly share code, notes, and snippets.

@Adamcbrz
Created June 9, 2016 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adamcbrz/18fd6612be67f99ac9b7ab5f870f8cc7 to your computer and use it in GitHub Desktop.
Save Adamcbrz/18fd6612be67f99ac9b7ab5f870f8cc7 to your computer and use it in GitHub Desktop.
Unity Generic Event
public class UnityGenericEvent<T0> : UnityEvent<T0> { }
public class UnityGenericEvent<T0, T1> : UnityEvent<T0, T1> { }
public class UnityGenericEvent<T0, T1, T2> : UnityEvent<T0, T1, T2> { }
public class UnityGenericEvent<T0, T1, T2, T3> : UnityEvent<T0, T1, T2, T3> { }
Then all you have to do is create events like:
public UnityGenericEvent<bool> onChange = new UnityGenericEvent<bool>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment