docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ArrayExtensions

    Array utilities functions

    Inheritance
    object
    ArrayExtensions
    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 static class ArrayExtensions

    Methods

    FillArray<T>(ref NativeArray<T>, in T, int, int)

    Fills an array with the same value.

    Declaration
    public static void FillArray<T>(this ref NativeArray<T> array, in T value, int startIndex = 0, int length = -1) where T : unmanaged
    Parameters
    Type Name Description
    NativeArray<T> array

    Target array to fill

    T value

    Value to fill

    int startIndex

    Start index to fill

    int length

    The number of entries to write, or -1 to fill until the end of the array

    Type Parameters
    Name Description
    T

    The type of the array

    ResizeArray(ref TransformAccessArray, int)

    Resizes a transform access array.

    Declaration
    public static void ResizeArray(this ref TransformAccessArray array, int capacity)
    Parameters
    Type Name Description
    TransformAccessArray array

    Target array to resize

    int capacity

    New size of transform access array to resize

    ResizeArray<T>(ref NativeArray<T>, int)

    Resizes a native array. If an empty native array is passed, it will create a new one.

    Declaration
    public static void ResizeArray<T>(this ref NativeArray<T> array, int capacity) where T : struct
    Parameters
    Type Name Description
    NativeArray<T> array

    Target array to resize

    int capacity

    New size of native array to resize

    Type Parameters
    Name Description
    T

    The type of the array

    ResizeArray<T>(ref T[], int)

    Resizes an array. If a null reference is passed, it will allocate the desired array.

    Declaration
    public static void ResizeArray<T>(ref T[] array, int capacity)
    Parameters
    Type Name Description
    T[] array

    Target array to resize

    int capacity

    New size of array to resize

    Type Parameters
    Name Description
    T

    The type of the array

    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)