docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct DynamicArray<T>.Iterator

    IEnumerator-like struct used to loop over this entire array. See the IEnumerator docs for more info: IEnumerator

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Rendering
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    public struct DynamicArray<T>.Iterator
    Remarks

    This struct intentionally does not explicitly implement the IEnumarable/IEnumerator interfaces it just follows the same function signatures. This means the duck typing used by foreach on the compiler level will pick it up as IEnumerable but at the same time avoids generating Garbage. For more info, see the C# language specification of the foreach statement.

    Constructors

    Iterator(DynamicArray<T>)

    Creates an iterator to iterate over an array.

    Declaration
    public Iterator(DynamicArray<T> setOwner)
    Parameters
    Type Name Description
    DynamicArray<T> setOwner

    The array to iterate over.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the array is null.

    Properties

    Current

    Gets the element in the DynamicArray at the current position of the iterator.

    Declaration
    public ref T Current { get; }
    Property Value
    Type Description
    T

    Methods

    MoveNext()

    Advances the iterator to the next element of the DynamicArray.

    Declaration
    public bool MoveNext()
    Returns
    Type Description
    bool

    Returns true if the iterator has successfully advanced to the next element; false if the iterator has passed the end of the DynamicArray.

    Exceptions
    Type Condition
    InvalidOperationException

    An operation changed the DynamicArray after the creation of this iterator.

    Reset()

    Sets the iterator to its initial position, which is before the first element in the DynamicArray.

    Declaration
    public void Reset()

    Extension Methods

    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, 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)