Struct BufferFromEntity<T> | Entities | 0.13.0-preview.24
docs.unity3d.com
    Show / Hide Table of Contents

    Struct BufferFromEntity<T>

    Namespace: Unity.Entities
    Syntax
    [NativeContainer]
    public struct BufferFromEntity<T>
        where T : struct, IBufferElementData
    Type Parameters
    Name Description
    T

    Properties

    Item[Entity]

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

    Methods

    DidChange(Entity, UInt32)

    Reports whether any of IBufferElementData components of the type T, in the chunk containing the specified Entity, could have changed.

    Declaration
    public bool DidChange(Entity entity, uint version)
    Parameters
    Type Name Description
    Entity entity

    The entity.

    UInt32 version

    The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled.

    Returns
    Type Description
    Boolean

    True, if the version number stored in the chunk for this component is more recent than the version passed to the version parameter.

    Remarks

    Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is incremented even when another job or system that has declared write access to a component does not actually change the component value.

    HasComponent(Entity)

    Reports whether the specified Entity instance still refers to a valid entity and that it has a buffer component of type T.

    Declaration
    public bool HasComponent(Entity entity)
    Parameters
    Type Name Description
    Entity entity

    The entity.

    Returns
    Type Description
    Boolean

    True if the entity has a buffer component of type T, and false if it does not. Also returns false if the Entity instance refers to an entity that has been destroyed.

    Remarks

    To report if the provided entity has a buffer component of type T, this function confirms whether the EntityArchetype of the provided entity includes buffer components of type T.

    In This Article
    • Properties
      • Item[Entity]
    • Methods
      • DidChange(Entity, UInt32)
      • HasComponent(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