# GetValidMethodInfo

> Given an object, function name, and a list of argument types; find the method that matches.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Events](/engine/6000.6/script-reference/unityengine/events.md)
* **Assembly:** UnityEngine.CoreModule

## GetValidMethodInfo(Object, string, Type\[])

Given an object, function name, and a list of argument types; find the method that matches.

```csharp
public static MethodInfo GetValidMethodInfo(object obj, string functionName, Type[] argumentTypes)
```

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): Object to search for the method.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Function name to search for.**** (\[Type\[]]\(https\://learn.microsoft.com/dotnet/api/system.type)): Argument types for the function.

### Returns

| Type                                                                              | Description |
| --------------------------------------------------------------------------------- | ----------- |
| [MethodInfo](https://learn.microsoft.com/dotnet/api/system.reflection.methodinfo) |             |

## GetValidMethodInfo(Type, string, Type\[])

Given an object type, function name, and a list of argument types; find the method that matches.

```csharp
public static MethodInfo GetValidMethodInfo(Type objectType, string functionName, Type[] argumentTypes)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): Object type to search for the method.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Function name to search for.**** (\[Type\[]]\(https\://learn.microsoft.com/dotnet/api/system.type)): Argument types for the function.

### Returns

| Type                                                                              | Description |
| --------------------------------------------------------------------------------- | ----------- |
| [MethodInfo](https://learn.microsoft.com/dotnet/api/system.reflection.methodinfo) |             |
