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) => { }; } }
/// <summary> /// Construct an either containing a B value. /// </summary> public InspectedMember(InspectedMethod method) { _property = null; _method = method; }
/// <summary> /// Construct an either containing an A value. /// </summary> public InspectedMember(InspectedProperty property) { _property = property; _method = null; }
public bool IsInterested(InspectedMethod method) { return(false); }
public bool IsInterested(InspectedMethod method) { return(method.Method.IsDefined(typeof(InspectorButtonAttribute), /*inherit:*/ true)); }