docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method ToComponentDataArrayAsync

    ToComponentDataArrayAsync<T>(AllocatorHandle, out JobHandle)

    Obsolete. Use ToComponentDataListAsync<T>(AllocatorHandle, out JobHandle) instead.

    Declaration
    [Obsolete("This method does not correctly support enableable components, and is generally unsafe. Use ToComponentDataListAsync() instead. (RemovedAfter Entities 1.0)")]
    public NativeArray<T> ToComponentDataArrayAsync<T>(AllocatorManager.AllocatorHandle allocator, out JobHandle jobhandle) where T : unmanaged, IComponentData
    Parameters
    Type Name Description
    AllocatorManager.AllocatorHandle allocator

    The type of memory to allocate.

    JobHandle jobhandle

    An out parameter assigned a handle that you can use as a dependency for a Job that uses the output data.

    Returns
    Type Description
    NativeArray<T>

    An array containing all the values of component type T selected by the query. The contents of this array must not be accessed before jobhandle has been completed.

    Type Parameters
    Name Description
    T

    The component type.

    Remarks

    Obsolete. Use ToComponentDataListAsync<T>(AllocatorHandle, out JobHandle) instead.

    Creates (and asynchronously populates) a NativeArray containing the value of component <code class="typeparamref">T</code>
    for the selected entities.
    
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown in the query contains any enableable components.

    InvalidOperationException

    Thrown if T is not part of the query.

    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)