docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetBuffer

    SetBuffer<T>()

    Replaces a DynamicBuffer of type T on the primary Entity

    Declaration
    [Obsolete("Use the version of the function with the explicit Entity parameter (RemovedAfter Entities 1.0)")]
    public DynamicBuffer<T> SetBuffer<T>() where T : unmanaged, IBufferElementData
    Returns
    Type Description
    DynamicBuffer<T>

    The new DynamicBuffer

    Type Parameters
    Name Description
    T

    The type of buffer to set

    Remarks

    This method can only be invoked if the same baker instance previously added this specific buffer. This is not a very common operation in bakers, but sometimes you have utility methods that add the relevant buffer and initialize them to a reasonable default state for that utility method, but then your baker needs to override the value of one of those added buffers to something specific in your particular baker.

    SetBuffer<T>(Entity)

    Replaces a DynamicBuffer of type T on the Entity

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

    The Entity to set the buffer on

    Returns
    Type Description
    DynamicBuffer<T>

    The new DynamicBuffer

    Type Parameters
    Name Description
    T

    The type of buffer to set

    Remarks

    This method can only be invoked if the same baker instance previously added this specific buffer. This is not a very common operation in bakers, but sometimes you have utility methods that add the relevant buffer and initialize them to a reasonable default state for that utility method, but then your baker needs to override the value of one of those added buffers to something specific in your particular baker.

    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)