Class ExtrasContainer
Application-specific data (extras) of a glTF JSON object.
Inherited Members
Namespace: Unity.Cloud.Gltfast.Objects
Assembly: Unity.Cloud.Gltfast.dll
Syntax
public class ExtrasContainer : AdditionalPropertyContainer, IPropertyContainer, IReadOnlyPropertyContainer
Remarks
The glTF specification allows extras to be any JSON value, not just an object. When it is
an object, its properties are accessible through IPropertyContainer. Otherwise
Kind reports the actual kind and RawValue provides the value.
Properties
Kind
The kind of JSON value this extras holds.
Declaration
[JsonIgnore]
public ValueKind Kind { get; }
Property Value
| Type | Description |
|---|---|
| ValueKind |
Remarks
Object for the common case, where the properties are accessible via
Count,
Keys, the indexer and
TryGetValue<T>(string, out T). Any other kind means the glTF
carried a non-object extras value; read it via RawValue. In that case
this container has no properties, so Count is 0 and Keys is empty.
See Also
RawValue
Declaration
[JsonIgnore]
public Value RawValue { get; }
Property Value
| Type | Description |
|---|---|
| Value | The value. Of kind Undefined if |
See Also
Methods
Clear()
Removes all properties.
Declaration
public override void Clear()
Overrides
Remarks
Also discards a non-object RawValue.
See Also
Set<T>(string, T)
Sets the property key to value, serialized to JSON.
Declaration
public override void Set<T>(string key, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The property name. |
| T | value | The value to store. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the value to serialize. |
Overrides
Remarks
Setting a property turns this extras into a JSON object, discarding a
non-object RawValue.