docs.unity.cn
    Show / Hide Table of Contents

    Method TryRead

    TryRead<U>(U, Int32, out BlobAssetReference<T>)

    Reads bytes from a binary reader, validates the expected serialized version, and deserializes them into a new blob asset.

    Declaration
    public static bool TryRead<U>(U binaryReader, int version, out BlobAssetReference<T> result)
        where U : BinaryReader
    Parameters
    Type Name Description
    U binaryReader

    The reader for the blob data path

    Int32 version

    Expected version number of the blob data.

    BlobAssetReference<T> result

    The resulting BlobAssetReference if the data was read successful.

    Returns
    Type Description
    Boolean

    True if the data was successfully read, false otherwise

    Type Parameters
    Name Description
    U

    The type of binary reader

    TryRead(String, Int32, out BlobAssetReference<T>)

    Reads bytes from a fileName, validates the expected serialized version, and deserializes them into a new blob asset.

    Declaration
    public static bool TryRead(string path, int version, out BlobAssetReference<T> result)
    Parameters
    Type Name Description
    String path

    The path of the blob data to read.

    Int32 version

    Expected version number of the blob data.

    BlobAssetReference<T> result

    The resulting BlobAssetReference if the data was read successful.

    Returns
    Type Description
    Boolean

    A bool if the read was successful or not.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023