A method that is being inspected, typically for the purpose of a button.
예제 #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) => { };
                }
            }
예제 #2
0
 /// <summary>
 /// Construct an either containing a B value.
 /// </summary>
 public InspectedMember(InspectedMethod method)
 {
     _property = null;
     _method = method;
 }
예제 #3
0
 /// <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;
 }
예제 #6
0
 public bool IsInterested(InspectedMethod method)
 {
     return(false);
 }
예제 #7
0
 public bool IsInterested(InspectedMethod method)
 {
     return(method.Method.IsDefined(typeof(InspectorButtonAttribute), /*inherit:*/ true));
 }