docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface INativeList<T>

    A resizable list.

    Inherited Members
    IIndexable<T>.Length
    IIndexable<T>.ElementAt(int)
    Namespace: Unity.Collections
    Assembly: Unity.Collections.dll
    Syntax
    public interface INativeList<T> : IIndexable<T> where T : unmanaged
    Type Parameters
    Name Description
    T

    The type of the elements.

    Properties

    Capacity

    The number of elements that fit in the current allocation.

    Declaration
    int Capacity { get; set; }
    Property Value
    Type Description
    int

    The number of elements that fit in the current allocation.

    IsEmpty

    Whether this list is empty.

    Declaration
    bool IsEmpty { get; }
    Property Value
    Type Description
    bool

    True if this list is empty.

    this[int]

    The element at an index.

    Declaration
    T this[int index] { get; set; }
    Parameters
    Type Name Description
    int index

    An index.

    Property Value
    Type Description
    T

    The element at the index.

    Exceptions
    Type Condition
    IndexOutOfRangeException

    Thrown if index is out of bounds.

    Methods

    Clear()

    Sets the length to 0.

    Declaration
    void Clear()
    Remarks

    Does not change the capacity.

    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)