docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IJsonAdapter<TValue>

    Implement this interface to override serialization and deserialization behaviour for a given type.

    Namespace: Unity.Serialization.Json
    Assembly: Unity.Serialization.dll
    Syntax
    public interface IJsonAdapter<TValue> : IJsonAdapter
    Type Parameters
    Name Description
    TValue

    The type to override serialization for.

    Methods

    Deserialize(in JsonDeserializationContext<TValue>)

    Invoked during deserialization to handle reading the specified TValue.

    Declaration
    TValue Deserialize(in JsonDeserializationContext<TValue> context)
    Parameters
    Type Name Description
    JsonDeserializationContext<TValue> context

    The current de-serialization context.

    Returns
    Type Description
    TValue

    The deserialized value.

    Serialize(in JsonSerializationContext<TValue>, TValue)

    Invoked during serialization to handle writing out the specified TValue.

    Declaration
    void Serialize(in JsonSerializationContext<TValue> context, TValue value)
    Parameters
    Type Name Description
    JsonSerializationContext<TValue> context

    The current serialization context.

    TValue value

    The value to write.

    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)