docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetDynamicComponentDataArrayReinterpret

    GetDynamicComponentDataArrayReinterpret<T>(ref DynamicComponentTypeHandle, int)

    Construct a NativeArray view of a chunk's component data.

    Declaration
    public readonly NativeArray<T> GetDynamicComponentDataArrayReinterpret<T>(ref DynamicComponentTypeHandle typeHandle, int expectedTypeSize) where T : struct
    Parameters
    Type Name Description
    DynamicComponentTypeHandle typeHandle

    Type handle for the target component type

    int expectedTypeSize

    The expected size (in bytes) of the target component type. It is an error to pass a size that does not match the target type's actual size.

    Returns
    Type Description
    NativeArray<T>

    A NativeArray which aliases the chunk's component value array for type T. The array does not own this data, and does not need to be disposed when it goes out of scope.

    Type Parameters
    Name Description
    T

    The target component type

    Exceptions
    Type Condition
    ArgumentException

    Thrown if T is an IBufferElementData. Use GetBufferAccessor<T>(ref BufferTypeHandle<T>) instead.

    InvalidOperationException

    Thrown if expectedTypeSize does not match the actual size of T, or if the data may not be safely aliased due to size constraints.

    GetDynamicComponentDataArrayReinterpret<T>(DynamicComponentTypeHandle, int)

    Obsolete. Use GetDynamicComponentDataArrayReinterpret<T>(ref DynamicComponentTypeHandle, int) instead.

    Declaration
    [Obsolete("The typeHandle argument should now be passed by ref. (RemovedAfter Entities 1.0)", false)]
    public readonly NativeArray<T> GetDynamicComponentDataArrayReinterpret<T>(DynamicComponentTypeHandle typeHandle, int expectedTypeSize) where T : struct
    Parameters
    Type Name Description
    DynamicComponentTypeHandle typeHandle

    Type handle for the target component type

    int expectedTypeSize

    The expected size (in bytes) of the target component type. It is an error to pass a size that does not match the target type's actual size.

    Returns
    Type Description
    NativeArray<T>

    A NativeArray which aliases the chunk's component value array for type T. The array does not own this data, and does not need to be disposed when it goes out of scope.

    Type Parameters
    Name Description
    T

    The target component type

    In This Article
    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)