docs.unity3d.com
    Show / Hide Table of Contents

    Struct ObjectInitializationData

    Contains data used to construct and initialize objects at runtime.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEngine.ResourceManagement.Util
    Syntax
    [Serializable]
    public struct ObjectInitializationData

    Properties

    Data

    String representation of the data that will be passed to the IInitializableObject.Initialize method of the created object. This is usually a JSON string of the serialized data object.

    Declaration
    public string Data { get; }
    Property Value
    Type Description
    String

    Id

    The object id.

    Declaration
    public string Id { get; }
    Property Value
    Type Description
    String

    ObjectType

    The object type that will be created.

    Declaration
    public SerializedType ObjectType { get; }
    Property Value
    Type Description
    SerializedType

    Methods

    CreateInstance<TObject>(String)

    Create an instance of the defined object. Initialize will be called on it with the id and data if it implements the IInitializableObject interface.

    Declaration
    public TObject CreateInstance<TObject>(string idOverride = null)
    Parameters
    Type Name Description
    String idOverride

    Optional id to assign to the created object. This only applies to objects that inherit from IInitializableObject.

    Returns
    Type Description
    TObject

    Constructed object. This object will already be initialized with its serialized data and id.

    Type Parameters
    Name Description
    TObject

    The instance type.

    GetAsyncInitHandle(ResourceManager, String)

    Create an instance of the defined object. This will get the AsyncOperationHandle for the async Initialization operation if the object implements the IInitializableObject interface.

    Declaration
    public AsyncOperationHandle GetAsyncInitHandle(ResourceManager rm, string idOverride = null)
    Parameters
    Type Name Description
    ResourceManager rm

    The current instance of Resource Manager

    String idOverride

    Optional id to assign to the created object. This only applies to objects that inherit from IInitializableObject.

    Returns
    Type Description
    AsyncOperationHandle

    AsyncOperationHandle for the async initialization operation if the defined type implements IInitializableObject, otherwise returns a default AsyncOperationHandle.

    ToString()

    Converts information about the initialization data to a formatted string.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    Returns information about the initialization data.

    Overrides
    ValueType.ToString()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023