docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IContravariantJsonMigration<TValue>

    Interface used to describe how a specified type should be migrated from one version to another.

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

    The type this interface defines migration for.

    Properties

    Version

    The current serialized version for the type.

    Declaration
    int Version { get; }
    Property Value
    Type Description
    int

    Methods

    Migrate(in JsonMigrationContext)

    Implement this method to manage migration for TValue.

    Declaration
    object Migrate(in JsonMigrationContext context)
    Parameters
    Type Name Description
    JsonMigrationContext context

    A context object used to unpack and transfer the data.

    Returns
    Type Description
    object

    The deserialized and migrated value.

    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)