Beispiel #1
0
        public void MoveEntitiesFrom(EntityManager srcEntities, ComponentGroup filter, NativeArray <EntityRemapUtility.EntityRemapInfo> entityRemapping)
        {
            if (filter.ArchetypeManager != srcEntities.ArchetypeManager)
            {
                throw new ArgumentException("EntityManager.MoveEntitiesFrom failed - srcEntities and filter must belong to the same World)");
            }
            NativeList <ArchetypeChunk> allMatchingChunks = filter.GetAllMatchingChunks(Allocator.TempJob);

            this.MoveEntitiesFrom(srcEntities, (NativeArray <ArchetypeChunk>)allMatchingChunks, entityRemapping);
            allMatchingChunks.Dispose();
        }
Beispiel #2
0
        public void MoveEntitiesFrom(EntityManager srcEntities, ComponentGroup filter, NativeArray <EntityRemapUtility.EntityRemapInfo> entityRemapping)
        {
#if ENABLE_UNITY_COLLECTIONS_CHECKS
            if (filter.ArchetypeManager != srcEntities.ArchetypeManager)
            {
                throw new ArgumentException("EntityManager.MoveEntitiesFrom failed - srcEntities and filter must belong to the same World)");
            }
#endif
            var chunks = filter.GetAllMatchingChunks(Allocator.TempJob);
            MoveEntitiesFrom(srcEntities, chunks, entityRemapping);
            chunks.Dispose();
        }