docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Property this

    this[Entity]

    Gets the DynamicBuffer<T> instance of type T for the specified entity.

    Declaration
    public DynamicBuffer<T> this[Entity entity] { get; }
    Parameters
    Type Name Description
    Entity entity

    The entity.

    Property Value
    Type Description
    DynamicBuffer<T>

    A DynamicBuffer<T> type.

    Remarks

    Normally, you cannot write to buffers accessed using a BufferLookup instance in a parallel Job. This restriction is in place because multiple threads could write to the same buffer, leading to a race condition and nondeterministic results. However, when you are certain that your algorithm cannot write to the same buffer from different threads, you can manually disable this safety check by putting the [NativeDisableParallelForRestriction] attribute on the BufferLookup field in the Job.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if entity does not have a buffer component of type T.

    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)