Library.RegisterFunction Method

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

public void RegisterFunction(string name, int parameterCount, Function implementation)


If parameterCount is -1, the function expects to receive any number of parameters.

If a function named name already exists in this Library, it will be replaced.


Parameter Description
string name The name of the function.
Int32 parameterCount The number of parameters that this function expects to receive.
Function implementation The Function to be invoked when the function is called.


Defined in YarnSpinner/Library.cs, line 252.