public InspectedMethod(MethodInfo method)
{
Method = method;
// We can consider methods with all-default parameters as no
// parameter methods
foreach (var param in method.GetParameters()) {
if (param.IsOptional) continue;
HasArguments = true;
break;
}
DisplayLabel = new GUIContent();
// DisplayLabel.text
{
var attr = fsPortableReflection.GetAttribute<InspectorNameAttribute>(method);
if (attr != null) {
DisplayLabel.text = attr.DisplayName;
}
if (string.IsNullOrEmpty(DisplayLabel.text)) {
DisplayLabel.text = fiDisplayNameMapper.Map(method.Name);
}
}
// DisplayLabel.tooltip
{
var attr = fsPortableReflection.GetAttribute<InspectorTooltipAttribute>(method);
if (attr != null) {
DisplayLabel.tooltip = attr.Tooltip;
}
}
}