public static IMethodBindingArgument DrawArgumentEditor(Type type, IMethodBindingArgument argument, string label, out bool change) { change = false; bool result = MethodBindingArgument.TryGetBindingArgumentTypeFromObjectType(argument.GetType(), out Enum bindingType); if (result) { if (bindingType is ChangeableMethodBindingArgumentType changeable) { var newBindingType = (ChangeableMethodBindingArgumentType)EditorGUILayout.EnumPopup( changeable, GUILayout.Width(70)); if (newBindingType != changeable) { argument = MethodBindingArgument.BuildArgumentOfType(argument.ArgName, type, newBindingType); change = true; } } } argument = GenericCustomEditors.DrawCustomEditor(argument, out _) as IMethodBindingArgument; return(argument); }
public static IMethodBindingArgument DrawArgumentEditor(MethodBinding binding, IMethodBindingArgument argument, string label, out bool change) => DrawArgumentEditor( binding ?.GetMethodInfo() ?.GetParameters() ?.FirstOrDefault(x => x.Name == argument.ArgName) ?.ParameterType, argument, label, out change);