docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method AddComponentData

    AddComponentData<T>(ForEachLambdaJobDescription, NativeArray<T>)

    Adds a component to a set of entities selected by the query you have defined using WithAny/WithAll/WithNone and sets the component of each entity in the query to the value in the component array.

    Declaration
    public static void AddComponentData<T>(this ForEachLambdaJobDescription description, NativeArray<T> componentArray) where T : unmanaged, IComponentData
    Parameters
    Type Name Description
    ForEachLambdaJobDescription description

    The target object

    NativeArray<T> componentArray

    NativeArray that contains the components.

    Type Parameters
    Name Description
    T

    The type of component to add.

    Remarks

    Can add any kind of component except chunk components, managed components, and shared components.

    componentArray.Length must match entityQuery.ToEntityArray().Length.

    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)