Class EntityInQueryIndex
Obsolete. Use EntityIndexInQuery instead.
Namespace: Unity.Entities
Assembly: solution.dll
Syntax
[AttributeUsage(AttributeTargets.Parameter)]
[Obsolete("Use EntityIndexInQuery (Removed after Entities 1.0) (UnityUpgradable) -> EntityIndexInQuery", true)]
public sealed class EntityInQueryIndex : Attribute
Remarks
Obsolete. Use EntityIndexInQuery instead.
Specifies that this int parameter is used as a way to get the packed entity index inside the current query.
Usage: An int parameter found inside the execute method of an IJobEntity.
This is generally way more expensive than <xref href="Unity.Entities.ChunkIndexInQuery" data-throw-if-not-resolved="false"></xref> and <xref href="Unity.Entities.EntityIndexInChunk" data-throw-if-not-resolved="false"></xref>.
As it it will schedule a <xref href="Unity.Entities.EntityQuery.CalculateBaseEntityIndexArrayAsync(Unity.Collections.AllocatorManager.AllocatorHandle%2cUnity.Jobs.JobHandle%2cUnity.Jobs.JobHandle%40)" data-throw-if-not-resolved="false"></xref> job to get an offset buffer.
If you just want a sortkey for your <xref href="Unity.Entities.EntityCommandBuffer.ParallelWriter" data-throw-if-not-resolved="false"></xref> simply use <xref href="Unity.Entities.ChunkIndexInQuery" data-throw-if-not-resolved="false"></xref>
as it is different for every thread, which is all a ParallelWriter needs to sort with.