Class InternalBufferCapacityAttribute | Entities | 0.16.0-preview.21
docs.unity3d.com
    Show / Hide Table of Contents

    Class InternalBufferCapacityAttribute

    Specifies the maximum number of elements to store inside a chunk.

    Inheritance
    Object
    Attribute
    InternalBufferCapacityAttribute
    Namespace: Unity.Entities
    Syntax
    [AttributeUsage(AttributeTargets.Struct)]
    public class InternalBufferCapacityAttribute : Attribute, _Attribute
    Remarks

    Use this attribute on the declaration of your IBufferElementData subtype:

    [InternalBufferCapacity(10)]
    public struct FloatBufferElement : IBufferElementData
    {
        public float Value;
    }

    All DynamicBuffer<T> with this type of element store the specified number of elements inside the chunk along with other component types in the same archetype. When the number of elements in the buffer exceeds this limit, the entire buffer is moved outside the chunk.

    Constructors

    InternalBufferCapacityAttribute(Int32)

    The number of elements stored inside the chunk.

    Declaration
    public InternalBufferCapacityAttribute(int capacity)
    Parameters
    Type Name Description
    Int32 capacity

    Fields

    Capacity

    The number of elements stored inside the chunk.

    Declaration
    public readonly int Capacity
    Field Value
    Type Description
    Int32
    In This Article
    • Constructors
      • InternalBufferCapacityAttribute(Int32)
    • Fields
      • Capacity
    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