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.