I have a class Trigger with some members of type SimpleAction:
public SimpleAction OnOver;
public SimpleAction OnOut;
public SimpleAction OnDown;
public SimpleAction OnUp;
public SimpleAction OnClick;
public SimpleAction OnHold;
Now, from another class I’m doing this:
MemberInfo[] members = triggerScript.GetType().GetMembers();
foreach (MemberInfo item in members) {
Debug.Log(item.Name);
}
In log massages I can see list of names of all members of Trigger class. OnOver, OnOut atc are in that list too. But how can I separate members of type SimpleAction from others?
item.DeclaringType is type of Trigger
item.MemberType is “field” for tham.
item.ReflectedType is Trigger too.
How can I get a member list of SimpleAction type?
Use method
GetFieldsthen filter field withFieldTypeisSimpleAction