RegisterFunction(string,Func<T1, TResult>)

Method in Library

Summary

Registers a new function that returns a value, which can be called from a Yarn program.

public void RegisterFunction<T1, TResult>(string name, Func<T1, TResult> implementation)

Parameters

NameDescription

string name

The name of the function.

System.Func<T1, TResult> implementation

The method to be invoked when the function is called.

Type Parameters

NameDescription

TResult

The return type of the function.

TResult

The return type of the function.

T1

The type of the function's first argument.

Last updated

Yarn Spinner® and Secret Lab® are trade marks of Secret Lab Pty. Ltd., and are used by Yarn Spinner Pty. Ltd. under license.