docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class DynamicArray<T>

    Generic growable array.

    Inheritance
    object
    DynamicArray<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Rendering
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    public class DynamicArray<T> where T : new()
    Type Parameters
    Name Description
    T

    Type of the array.

    Constructors

    Name Description
    DynamicArray()

    Constructor. Defaults to a size of 32 elements.

    DynamicArray(int)

    Constructor

    Properties

    Name Description
    this[int]

    ref access to an element.

    capacity

    Allocated size of the array.

    size

    Number of elements in the array.

    Methods

    Name Description
    Add(in T)

    Add an element to the array.

    AddRange(DynamicArray<T>)

    Adds the elements of the specified collection to the end of the DynamicArray.

    Clear()

    Clear the array of all elements.

    Contains(T)

    Determines whether the DynamicArray contains a specific value.

    FindIndex(int, int, Predicate<T>)

    Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the DynamicArray that starts at the specified index and contains the specified number of elements.

    GetEnumerator()

    Returns an enumerator that iterates through of this array. See the IEnumerable docs for more info: https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerable

    IndexOf(T)

    Searches for the specified object and returns the zero-based index of the first occurrence within the entire DynamicArray.

    IndexOf(T, int)

    Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the DynamicArray that extends from the specified index to the last element.

    IndexOf(T, int, int)

    Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the DynamicArray that starts at the specified index and contains the specified number of elements.

    Remove(T)

    Removes the first occurrence of a specific object from the DynamicArray.

    RemoveAt(int)

    Removes the element at the specified index of the DynamicArray.

    RemoveRange(int, int)

    Removes a range of elements from the DynamicArray.

    Reserve(int, bool)

    Sets the total number of elements the internal data structure can hold without resizing.

    Resize(int, bool)

    Resize the Dynamic Array. This will reallocate memory if necessary and set the current size of the array to the provided size.

    SubRange(int, int)

    Returns an IEnumeralbe-Like object that iterates through a subsection of this array.

    Operators

    Name Description
    implicit operator T[](DynamicArray<T>)

    Implicit conversion to regular array.

    Extension Methods

    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, bool)
    DynamicArrayExtensions.QuickSort<T>(DynamicArray<T>, DynamicArray<T>.SortComparer)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)