public Button(string methodName) { InspectedMethod foundMethod = null; foreach (var method in InspectedType.Get(typeof(T)).GetMethods(InspectedMemberFilters.All)) { if (method.Method.Name == methodName) { foundMethod = method; } } if (foundMethod != null) { _label = (fiGUIContent)foundMethod.DisplayLabel; _enabled = true; _onClick = (o, c) => foundMethod.Invoke(o); } else { Debug.LogError("Unable to find method " + methodName + " on " + typeof(T).CSharpName()); _label = new fiGUIContent(methodName + " (unable to find on " + typeof(T).CSharpName() + ")"); _enabled = false; _onClick = (o, c) => { }; } }