docs.unity.cn
    Show / Hide Table of Contents

    Class EntityInQueryIndex

    Obsolete. Use EntityIndexInQuery instead.

    Inheritance
    Object
    Attribute
    EntityInQueryIndex
    Namespace: Unity.Entities
    Syntax
    [AttributeUsage(AttributeTargets.Parameter)]
    [Obsolete("Use EntityIndexInQuery (Removed after Entities 1.0) (UnityUpgradable) -> EntityIndexInQuery", true)]
    public sealed class EntityInQueryIndex : Attribute, _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 CalculateBaseEntityIndexArrayAsync(AllocatorManager.AllocatorHandle, JobHandle, out JobHandle) 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.

    See Also

    IJobEntity
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023