EntityInQueryIndex
Obsolete. Use EntityIndexInQuery instead.
Read time 3 minutesLast updated 10 hours ago
Definition
- Type: Class
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Parameter)]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 ChunkIndexInQuery and EntityIndexInChunk. As it it will schedule a EntityQuery.CalculateBaseEntityIndexArrayAsync job to get an offset buffer. If you just want a sortkey for your EntityCommandBuffer.ParallelWriter simply use ChunkIndexInQuery as it is different for every thread, which is all a ParallelWriter needs to sort with.
Additional Resources: IJobEntity