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

Value

A value from inside Yarn.
public class Value : IYarnValue, IConvertible

Inherits from System.Object

Implements Yarn.IYarnValue, System.IConvertible

#Constructors

#Value(IType, IConvertible)

Initializes a new instance of the Value class, using the specified object.
public Value(IType type, IConvertible internalValue)

Parameters

  • value(unknown)
    The value that this Value should contain.
  • internalValueSystem.IConvertible
If the value is another Value, its contents will be copied into the new instance.

#Value(Value)

Initializes a new instance of the Value class, using the specified object.
public Value(Value value)

Parameters

If the value is another Value, its contents will be copied into the new instance.

#Properties

#Type

The type of this value. Because Yarn has a much simpler list of supported types (numbers, bools, strings) and internally Yarn values are IConvertible without having an associated type we wouldn't know how to handle the value
public Yarn.IType Type { get; internal set; }

Type IType

#Methods

#CompareTo(object)

Compares this Value to another object. The other object must either be another instance of Value, or null.
public int CompareTo(object obj)

Parameters

  • objobject
    The object to compare to.

Returns Int32: Returns the same results as System.IComparable.CompareTo(System.Object).

Exceptions

  • System.ArgumentException
    Thrown when obj is not a Value.

#ConvertTo(System.Type)

Converts a value from it's current form to the requested type
public object ConvertTo(System.Type targetType)

Parameters

  • targetTypeSystem.Type
    The new type

Returns Object: the value now as a converted object

#ConvertTo<T>()

Converts a value from it's current form to the requested type
public T ConvertTo<T>()
    where T : IConvertible

Parameters

  • targetType(unknown)
    The new type

Returns T: the value now as a converted object

#From(IConvertible)

Creates a new value from any IConvertible
public static Value From(IConvertible convertible)

Parameters

  • convertibleSystem.IConvertible
    The IConvertible desired to be converted into a Yarn value

Returns Value: The Yarn value

#GetHashCode()

public override int GetHashCode()

Returns Int32

#GetTypeCode()

public TypeCode GetTypeCode()

Returns TypeCode

#ToBoolean(IFormatProvider)

public bool ToBoolean(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns Boolean

#ToByte(IFormatProvider)

public byte ToByte(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns Byte

#ToChar(IFormatProvider)

public char ToChar(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns Char

#ToDateTime(IFormatProvider)

public DateTime ToDateTime(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns DateTime

#ToDecimal(IFormatProvider)

public decimal ToDecimal(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns Decimal

#ToDouble(IFormatProvider)

public double ToDouble(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns Double

#ToInt16(IFormatProvider)

public short ToInt16(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns Int16

#ToInt32(IFormatProvider)

public int ToInt32(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns Int32

#ToInt64(IFormatProvider)

public long ToInt64(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns Int64

#ToSByte(IFormatProvider)

public sbyte ToSByte(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns SByte

#ToSingle(IFormatProvider)

public float ToSingle(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns Single

#ToString()

Converts this value to a string.
public override string ToString()

Returns String: The string representation of this value

#ToString(IFormatProvider)

public string ToString(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns String

#ToType(Type, IFormatProvider)

public object ToType(Type conversionType, IFormatProvider provider)

Parameters

  • conversionTypeSystem.Type
  • providerSystem.IFormatProvider

Returns Object

#ToUInt16(IFormatProvider)

public ushort ToUInt16(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns UInt16

#ToUInt32(IFormatProvider)

public uint ToUInt32(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns UInt32

#ToUInt64(IFormatProvider)

public ulong ToUInt64(IFormatProvider provider)

Parameters

  • providerSystem.IFormatProvider

Returns UInt64

Generated from Yarn Spinner for Unity 3.3.