> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/2.2/api/csharp/yarn.unity/yarn.unity.dialoguerunner/yarn.unity.dialoguerunner.addfunction-4.md).

# AddFunction(string,System.Func\<TResult, T1, T2>)

Method in [DialogueRunner](/2.2/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md)

## Summary

```csharp
public void AddFunction<TResult, T1, T2>(string name, System.Func<TResult, T1, T2> implementation)
```

## Parameters

| Name                                          | Description |
| --------------------------------------------- | ----------- |
| `string` name                                 |             |
| `System.Func<TResult, T1, T2>` implementation |             |

## Type Parameters

| Name | Description                                       |
| ---- | ------------------------------------------------- |
| T2   | The type of the second parameter to the function. |
