docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ExtrasContainer

    Application-specific data (extras) of a glTF JSON object.

    Inheritance
    object
    AdditionalPropertyContainer
    ExtrasContainer
    MeshExtras
    Implements
    IPropertyContainer
    IReadOnlyPropertyContainer
    Inherited Members
    AdditionalPropertyContainer.Count
    AdditionalPropertyContainer.ContainsKey(string)
    AdditionalPropertyContainer.Keys
    AdditionalPropertyContainer.this[string]
    AdditionalPropertyContainer.Remove(string)
    AdditionalPropertyContainer.GetEnumerator()
    AdditionalPropertyContainer.TryGetValue<T>(string, out T)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras

    RawValue

    The extras value, for when Kind is not Object.

    Declaration
    [JsonIgnore]
    public Value RawValue { get; }
    Property Value
    Type Description
    Value

    The value. Of kind Undefined if extras is an object.

    See Also
    https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras

    Methods

    Clear()

    Removes all properties.

    Declaration
    public override void Clear()
    Overrides
    AdditionalPropertyContainer.Clear()
    Remarks

    Also discards a non-object RawValue.

    See Also
    https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras

    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
    AdditionalPropertyContainer.Set<T>(string, T)
    Remarks

    Setting a property turns this extras into a JSON object, discarding a non-object RawValue.

    See Also
    https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras

    Implements

    IPropertyContainer
    IReadOnlyPropertyContainer

    See Also

    https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)