docs.unity3d.com
    Show / Hide Table of Contents

    Method GetBuffer

    GetBuffer<T>(Entity)

    Gets the dynamic buffer of an entity.

    Declaration
    public DynamicBuffer<T> GetBuffer<T>(Entity entity)
        where T : struct, IBufferElementData
    Parameters
    Type Name Description
    Entity entity

    The entity.

    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.

    Remarks

    When you call this method on the main thread, it invokes GetBuffer<T>(Entity). (An [Entities.ForEach] function invoked with Run() executes on the main thread.) When you call this method inside a job scheduled using [Entities.ForEach], this method gets replaced with component access methods through BufferFromEntity<T>.

    In This Article
    • GetBuffer<T>(Entity)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023