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

UnknownParameter

Represents a parameter whos type either is something we can't handle in a Yarn action, or one whos conversion hasn't been resolved yet.
(no declaration available)

Inherits from Yarn.Shared.Parameter

Implements System.IEquatable{Yarn.Shared.Parameter}, System.IEquatable{Yarn.Shared.UnknownParameter}

Because the different stages of accumulating potential actions can run in different timings we may well have a collection of potential actions before we can resolve all the types. This parameter type exists to represent them, maybe it will be resolved to something at a later stage, maybe it won't. In general if you encounter one of these at source gen it means something has failed.

#Properties

#ShortFormType

What is the short form for display and injection into generated scripts of this type? So for a boolean parameter this would return "bool"
public override string ShortFormType { get }

Type String

#Methods

#CreateCommandParameterString(int, int)

When it comes time to invoke a command all parameters need to convert their value from the strings provided by Yarn into their appropriate C# form. Because we use source gen to actually invoke the commands we need to know what the string representation of the C# to do this would look like. This is what this method does, given it's own understanding of the parameter and where it is in the action create valid C# to perform the conversion.
public override string CreateCommandParameterString(int parameterIndex, int arrayIndex)

Parameters

  • parameterIndexint
    What index is the current parameter? So if the method is something like name(a,b) then the a parameter will have an index here of 0.
  • arrayIndexint
    What index is the current into the array of provided values from Yarn? This is superficially similar to the parameterIndex, but may not be the same: commands have as element 0 the name of the command, and in the case of instance methods there is an implied this in C#, which is explicit in the Yarn - meaning the index values here will be shifted along one. Relatedly, some parameter types (such as tokens) have no corresponding values in the array of parameters provided from Yarn.

Returns String: The fully built command parameter string ready to be injected into the generated source.

Exceptions

  • System.ArgumentException
    Because there is no concept of converting a value from Yarn into an unknown type this method always throws

#CreateFunctionParameterString(int, int)

When it comes time to invoke a function all parameters need to convert their value from the values provided by Yarn into their appropriate C# form. Because we use source gen to actually invoke the function we need to know what the string representation of the C# to do this would look like. This is what this method does, given it's own understanding of the parameter and where it is in the action create valid C# to perform the conversion.
public override string CreateFunctionParameterString(int parameterIndex, int arrayIndex)

Parameters

  • parameterIndexint
    what index is the current parameter? So if the method is something like name(a,b) then the a parameter will have an index here of 0.
  • arrayIndexint
    What index is the current into the array of provided values from Yarn? This is superficially similar to the , but may not be the same: in the case of instance methods, there is an implied this in C#, which is explicit in the Yarn - meaning the index values here will be shifted along one. Relatedly, some parameter types (such as tokens) have no corresponding values in the array of parameters provided from Yarn.

Returns String: The fully built function parameter string ready to be injected into the generated source.

Exceptions

  • System.ArgumentException
    Because there is no concept of converting a value from Yarn into an unknown type this method always throws

Generated from Yarn Spinner for Unity 3.3.