public static class Events{ public static PlayerEvents Player { get; } = new PlayerEvents();}
public class PlayerEvents{ public event Event<PlayerLeftServer> Leaving; public event Event<PlayerLeftServer> Left;}
foreach (var property in typeof(Events).GetProperties(BindingFlags.Public | BindingFlags.Static)) { foreach (var ev in property.PropertyType.GetEvents()) { FieldInfo evField = property.PropertyType.GetField(ev.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.GetField); // GetValue returns null Debug.Log(evField.GetValue(property.GetValue(null, null))); } }