docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CreateArrayFilledWithValue

    CreateArrayFilledWithValue<T>(T, int, Allocator)

    Creates a new array allocated with allocator and initialized with length copies of value.

    Declaration
    public static NativeArray<T> CreateArrayFilledWithValue<T>(T value, int length, Allocator allocator) where T : struct
    Parameters
    Type Name Description
    T value

    The value with which to fill the array.

    int length

    The length of the array to create.

    Allocator allocator

    The allocator with which to create the NativeArray.

    Returns
    Type Description
    NativeArray<T>

    A new NativeArray initialized with copies of value.

    Type Parameters
    Name Description
    T

    The type of the NativeArray to create. Must be a struct.

    In This Article
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Friday, September 22, 2023