docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CopyFromReadOnlyCollection

    CopyFromReadOnlyCollection<T>(IReadOnlyCollection<T>, NativeArray<T>)

    Copies the contents of source into the NativeArray destination. The lengths of both collections must match.

    Declaration
    public static void CopyFromReadOnlyCollection<T>(IReadOnlyCollection<T> source, NativeArray<T> destination) where T : struct
    Parameters
    Type Name Description
    IReadOnlyCollection<T> source

    The IReadOnlyCollection that provides the data

    NativeArray<T> destination

    The NativeArray that will be written to

    Type Parameters
    Name Description
    T

    The type of the NativeArray structs that will be copied

    Remarks

    Prefer IReadOnlyList over IReadOnlyCollection for copy performance where possible.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when there is a mismatch between source and destination sizes.

    See Also
    CopyFromReadOnlyList<T>(IReadOnlyList<T>, NativeArray<T>)
    In This Article
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Friday, September 22, 2023