docs.unity.cn
    Show / Hide Table of Contents

    Method GetBuffer

    GetBuffer<T>(Entity, Boolean)

    Gets the dynamic buffer of an entity.

    Declaration
    [GenerateTestsForBurstCompatibility(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.

    GetBuffer<T>(SystemHandle, Boolean)

    Gets the dynamic buffer of an entity associated with a system.

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

    The system handle.

    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 © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023