docs.unity.cn
    Show / Hide Table of Contents

    Class ListExtensions

    Extension methods for List<T> objects

    Inheritance
    Object
    ListExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.XR.CoreUtils
    Syntax
    public static class ListExtensions

    Methods

    EnsureCapacity<T>(List<T>, Int32)

    Ensure that the capacity of this list is at least as large the given value

    Declaration
    public static void EnsureCapacity<T>(this List<T> list, int capacity)
    Parameters
    Type Name Description
    List<T> list

    The list whose capacity will be ensured

    Int32 capacity

    The minimum number of elements the list storage must contain

    Type Parameters
    Name Description
    T

    The list element type

    Fill<T>(List<T>, Int32)

    Fill the list with default objects of type T

    Declaration
    public static List<T> Fill<T>(this List<T> list, int count)
        where T : new()
    Parameters
    Type Name Description
    List<T> list

    The list

    Int32 count

    The number of items to fill the list with

    Returns
    Type Description
    List<T>

    The list that was filled

    Type Parameters
    Name Description
    T

    The type of objects in this list

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, December 21, 2022
    Terms of use