Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

EntityQuery.CopyFromComponentDataListAsync

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void CopyFromComponentDataListAsync(NativeList<T> componentDataList, out JobHandle outJobHandle);

Parameters

Parameter Description
componentDataList The values to copy into the matching entities.
outJobHandle An out parameter assigned a handle that you can use as a dependency for a Job that should happen after this operation completes.

Description

Asynchronously copies the values of component type T in a NativeList into the entities matched by this query.

The job scheduled by this call will automatically use the component safety system to determine its input dependencies, to avoid the most common race conditions. If additional input dependencies are required beyond what the component safety system knows about, use EntityQuery.CopyFromComponentDataListAsync.

This method is generally used in conjunction with EntityQuery.ToComponentDataListAsync to extract component values, pass them into some code that expects a flat array of values, and then scatter the updated values back to entities.


Declaration

public void CopyFromComponentDataListAsync(NativeList<T> componentDataList, JobHandle additionalInputDep, out JobHandle outJobHandle);

Parameters

Parameter Description
componentDataList The values to copy into the matching entities.
additionalInputDep A job handle which the newly scheduled job will depend upon, in addition to the dependencies automatically determined by the component safety system.
outJobHandle An out parameter assigned a handle that you can use as a dependency for a Job that should happen after this operation completes.

Description

Asynchronously copies the values of component type T in a NativeList into the entities matched by this query.

This method is generally used in conjunction with EntityQuery.ToComponentDataListAsync to extract component values, pass them into some code that expects a flat array of values, and then scatter the updated values back to entities.