EnumTypeBuilder
public class EnumTypeBuilderInherits from System.Object
With-prefixed methods to set properties. When you're done, access
the EnumType property to get the final, constructed EnumType.#Properties
#EnumType
#Methods
#FromEnum<TEnum>(string?)
public static EnumType FromEnum<TEnum>(string? description = null)
where TEnum : System.EnumType Parameters
TEnumThe type of the CLR enum.
Parameters
descriptionstringAn optional description to apply to the new Yarn enum type.
Returns EnumType: A Yarn type representing the enum.
#WithCase(string, float, string?)
public EnumTypeBuilder WithCase(string caseName, float rawValue, string? description)Parameters
caseNamestringThe name of the case, as it appears in Yarn Spinner scripts.rawValuefloatThe raw value of the case.descriptionstringThe optional description for the case.rawType(unknown)The type of the case.
Returns EnumTypeBuilder: The EnumTypeBuilder instance that received
this method call.
Exceptions
System.ArgumentExceptionThrown if the raw type doesn't match the enum's type, if a case with the given name already exists, or if a case with the given value already exists.
#WithCase(string, string, string?)
public EnumTypeBuilder WithCase(string caseName, string rawValue, string? description)Parameters
caseNamestringThe name of the case, as it appears in Yarn Spinner scripts.rawValuestringThe raw value of the case.descriptionstringThe optional description for the case.
Returns EnumTypeBuilder: The EnumTypeBuilder instance that received
this method call.
Exceptions
System.ArgumentExceptionThrown if the raw type doesn't match the enum's type, if a case with the given name already exists, or if a case with the given value already exists.
#WithDescription(string)
public EnumTypeBuilder WithDescription(string description)Parameters
descriptionstringThe new description.
Returns EnumTypeBuilder: The EnumTypeBuilder instance that received
this method call.
#WithName(string)
public EnumTypeBuilder WithName(string name)Parameters
namestringThe new name.
Returns EnumTypeBuilder: The EnumTypeBuilder instance that received
this method call.
#WithRawType(IType)
public EnumTypeBuilder WithRawType(IType rawType)Parameters
rawTypeYarn.ITypeThe new raw type.
Returns EnumTypeBuilder: The EnumTypeBuilder instance that received
this method call.
Exceptions
System.InvalidOperationExceptionThrown if the enum has any cases added to it.System.ArgumentExceptionThrown ifrawTypeis neither a string type nor a number type.
Generated from Yarn Spinner for Unity 3.3.