docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Serialize

    Serialize(Allocator)

    Serialize the ARWorldMap to an array of bytes. This array can be saved to disk and loaded at another time to persist the session, or sent over a network to another ARKit-enabled app to share the session. It is an error to call this method after the ARWorldMap has been disposed. The caller owns the returned NativeArray and is responsible for disposing it.

    Declaration
    public NativeArray<byte> Serialize(Allocator allocator)
    Parameters
    Type Name Description
    Allocator allocator

    The allocator to use for the returned NativeArray of bytes.

    Returns
    Type Description
    NativeArray<byte>

    An array of bytes representing the serialized ARWorldMap. The caller owns the memory and is responsible for disposing the NativeArray.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the world map is not valid.

    InvalidOperationException

    Thrown if the world map could not be serialized to a byte array.

    In This Article
    • Serialize(Allocator)
    Back to top
    Copyright © 2024 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)