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).

FunctionType

A type that represents a function.
public class FunctionType : IType, IEquatable<IType>

Inherits from System.Object

Implements Yarn.IType, System.IEquatable{Yarn.IType}

Functions have parameters and a return type, and can be called from scripts. These can be created directly or via the Definitions file.

#Constructors

#FunctionType(IType, IType[])

Initialises a new instances of the FunctionType class.
public FunctionType(IType returnType, params IType[] parameterTypes)

Parameters

  • returnTypeYarn.IType
    The type of the value that this type of function returns.
  • parameterTypesYarn.IType[]
    The types of the parameters that this type of function accepts.

#Properties

#Description

Gets a more verbose description of this type.
public string Description { get; set; }

Type String

#Name

Gets the name of this type.
public string Name { get; }

Type String

#Parameters

Gets the list of the parameter types that this function is called with.
public List<IType> Parameters { get; internal set; }

Type List

The length of this list also determines the number of parameters this function accepts (also known as the function's arity).

#Parent

Gets the parent of this type.
public IType Parent { get; }

Type IType

All types have Any as their ultimate parent type (except for Any itself.)

#ReturnType

Gets the type of value that this function returns.
public IType ReturnType { get; internal set; }

Type IType

#TypeMembers

Gets the collection of type information for this type's type members.
public IReadOnlyDictionary<string, ITypeMember> TypeMembers { get }

Type IReadOnlyDictionary

#VariadicParameterType

Gets the type of value that this type of function accepts as a variadic parameter.
public IType? VariadicParameterType { get; internal set; }

Type IType

This value is null if this type of function does not accept variadic parameters.

#Methods

#Equals(IType)

public bool Equals(IType other)

Parameters

Returns Boolean

#GetParameterAt(int)

Gets the type of the parameter at the given index.
public IType GetParameterAt(int index)

Parameters

  • indexint
    The index of the parameter to get the type for.

Returns IType: The type of the parameter. If index is beyond the length of Parameters, and VariadicParameterType is not null, VariadicParameterType is returned.

Exceptions

#ToString()

public override string ToString();

Returns String

Generated from Yarn Spinner for Unity 3.3.