private static List <OrderAttrMethod> FindAllMethod(Type type) { var types = GetAllSubTypesInScripts(); var ret = new List <OrderAttrMethod>(); foreach (var mono in types) { MethodInfo[] methods = mono.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo method in methods) { if (method.IsDefined(type, false)) { OrderableAttr attr = (OrderableAttr)(method.GetCustomAttributes(type, true)[0]); ret.Add(new OrderAttrMethod(attr, method)); } } } return(ret); }
public OrderAttrMethod(OrderableAttr attr, MethodInfo method) { this.method = method; this.attr = attr; }