docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct JsonSerializationContext<TValue>

    The JsonSerializationContext<TValue> is available from adapters. It provides access to the current adapter enumerator and allows for control of serialization for a given type.

    Implements
    IJsonSerializationContext
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Serialization.Json
    Assembly: Unity.Serialization.dll
    Syntax
    public readonly struct JsonSerializationContext<TValue> : IJsonSerializationContext
    Type Parameters
    Name Description
    TValue

    The value type being serialized.

    Properties

    Writer

    Gets the underlying JsonWriter which can be used to output formatted data.

    Declaration
    public JsonWriter Writer { get; }
    Property Value
    Type Description
    JsonWriter

    Methods

    ContinueVisitation()

    Continues visitation for the current type. This will run the next adapter in the sequence, or the default behaviour.

    Declaration
    public void ContinueVisitation()

    ContinueVisitationWithoutAdapters()

    Continues visitation for the current type without running any more adapters. This will perform the default behaviour.

    Declaration
    public void ContinueVisitationWithoutAdapters()

    SerializeValue<T>(string, T)

    Writes the given key-value pair to the output. This will run all adapters.

    Declaration
    public void SerializeValue<T>(string key, T value)
    Parameters
    Type Name Description
    string key

    The key to write.

    T value

    The value to write.

    Type Parameters
    Name Description
    T

    The value type to write.

    SerializeValue<T>(T)

    Writes the given value to the output. This will run all adapters.

    Declaration
    public void SerializeValue<T>(T value)
    Parameters
    Type Name Description
    T value

    The value to write.

    Type Parameters
    Name Description
    T

    The value type to write.

    Implements

    IJsonSerializationContext
    In This Article
    Back to top
    Copyright © 2025 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)