docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetUntypedBufferAccessorReinterpret

    GetUntypedBufferAccessorReinterpret<T>(ref DynamicComponentTypeHandle, int)

    Construct a typed BufferAccessor view of a chunk's buffer component data from an untyped component handle.

    Declaration
    public readonly BufferAccessor<T> GetUntypedBufferAccessorReinterpret<T>(ref DynamicComponentTypeHandle typeHandle, int expectedElementTypeSize) where T : unmanaged, IBufferElementData
    Parameters
    Type Name Description
    DynamicComponentTypeHandle typeHandle

    Buffer type handle for the target component type

    int expectedElementTypeSize

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

    Returns
    Type Description
    BufferAccessor<T>

    A BufferAccessor<T> which aliases the chunk's component value array for type T.

    Type Parameters
    Name Description
    T

    The target buffer component type

    Exceptions
    Type Condition
    ArgumentException

    Thrown if typeHandle is not a handle to a buffer type. For regular component types, use GetDynamicComponentDataArrayReinterpret<T>(ref DynamicComponentTypeHandle, int) instead.

    InvalidOperationException

    Thrown if expectedElementTypeSize does not match the actual size of T, if the two buffer types have different InternalBufferCapacityAttribute values, or if the data may not be safely aliased due to size constraints.

    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)