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)));
}
}
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)));
}
}