Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

FunctionTypeBuilder

Provides methods for constructing FunctionType objects.
public class FunctionTypeBuilder

Inherits from System.Object

To use this class, create an instance of it, and call the With-prefixed methods to set properties. When you're done, access the FunctionType property to get the final, constructed FunctionType.

#Properties

#FunctionType

Gets the FunctionType instance constructed by this FunctionTypeBuilder.
public FunctionType FunctionType { get; }

Type FunctionType

#Methods

#FromFunctionType(System.Type)

Creates a new FunctionTypeBuilder based on a delegate type.
public static FunctionTypeBuilder FromFunctionType(System.Type type)

Parameters

  • typeSystem.Type
    The type of a delegate to produce a type builder from. This type must be a delegate.

Returns FunctionTypeBuilder: A newly created FunctionTypeBuilder.

Exceptions

  • System.ArgumentException
    Thrown when the provided type is not a delegate or has invalid components.

#WithParameter(IType)

Adds a new parameter of type parameterType to the FunctionType.
public FunctionTypeBuilder WithParameter(IType parameterType)

Parameters

  • parameterTypeYarn.IType
    The type of the new parameter to add to the function.

Returns FunctionTypeBuilder: The FunctionTypeBuilder instance that received this method call.

#WithReturnType(IType)

Sets the ReturnType of the FunctionType.
public FunctionTypeBuilder WithReturnType(IType returnType)

Parameters

  • returnTypeYarn.IType
    The return type to apply to the function.

Returns FunctionTypeBuilder: The FunctionTypeBuilder instance that received this method call.

#WithVariadicParameterType(IType?)

public FunctionTypeBuilder WithVariadicParameterType(IType? variadicParameterType)

Parameters

  • variadicParameterTypeYarn.IType
    The variadic parameter type to apply to the function.

Returns FunctionTypeBuilder: The FunctionTypeBuilder instance that received this method call.

Generated from Yarn Spinner for Unity 3.3.