Api Sandbox Variant
struct

Variant

public sealed struct Variant

A Variant is a type that can hold any value, and also keeps track of the type of the value it holds. It's useful for cases where you want to store a value of an unknown type, or when you want to serialize/deserialize values of various types in a generic way.

Constructors

Variant(Object o, Type t)

Properties

Name Type Description
Type Type The type of the value currently stored in the Variant. This is automatically set when you assign a value to the Variant.
Value Object Gets or sets the value associated with this instance.

Methods

T Get()
static override Object JsonRead(Utf8JsonReader reader, Type typeToConvert)
static override Void JsonWrite(Object value, Utf8JsonWriter writer)
Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.Variant