A method that is being inspected, typically for the purpose of a button.
Esempio n. 1
0
            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;
 }
 /// <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;
 }
Esempio n. 6
0
 public bool IsInterested(InspectedMethod method)
 {
     return(false);
 }
Esempio n. 7
0
 public bool IsInterested(InspectedMethod method)
 {
     return(method.Method.IsDefined(typeof(InspectorButtonAttribute), /*inherit:*/ true));
 }