docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CreateSerializedInitializationData

    CreateSerializedInitializationData(Type, string, object)

    Construct a serialized data for the object.

    Declaration
    public static ObjectInitializationData CreateSerializedInitializationData(Type objectType, string id = null, object dataObject = null)
    Parameters
    Type Name Description
    Type objectType

    The type of object to create.

    string id

    The object id.

    object dataObject

    The serializable object that will be saved into the Data string via the JSONUtility.ToJson method.

    Returns
    Type Description
    ObjectInitializationData

    Contains data used to construct and initialize an object at runtime.

    CreateSerializedInitializationData<T>(string, object)

    Construct a serialized data for the object.

    Declaration
    public static ObjectInitializationData CreateSerializedInitializationData<T>(string id = null, object dataObject = null)
    Parameters
    Type Name Description
    string id

    The ID for the object

    object dataObject

    The serializable object that will be saved into the Data string via the JSONUtility.ToJson method.

    Returns
    Type Description
    ObjectInitializationData

    Contains data used to construct and initialize an object at runtime.

    Type Parameters
    Name Description
    T

    The type of object to create.

    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)