docs.unity.cn
    Show / Hide Table of Contents

    Method GetBuffer

    GetBuffer<T>(Entity, Boolean)

    Gets the dynamic buffer of an entity.

    Declaration
    [BurstCompatible(GenericTypeArguments = new Type[]{typeof(BurstCompatibleBufferElement)})]
    public DynamicBuffer<T> GetBuffer<T>(Entity entity, bool isReadOnly = false)
        where T : struct, IBufferElementData
    Parameters
    Type Name Description
    Entity entity

    The entity.

    Boolean isReadOnly

    Specify whether the access to the component through this object is read only or read and write.

    Returns
    Type Description
    DynamicBuffer<T>

    The DynamicBuffer object for accessing the buffer contents.

    Type Parameters
    Name Description
    T

    The type of the buffer's elements.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if T is an unsupported type.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, July 6, 2022
    Terms of use