Exemplo n.º 1
0
        static void DestroyChunkForDiffing(EntityManager entityManager, Chunk *chunk)
        {
            var count = chunk->Count;

            ChunkDataUtility.DeallocateBuffers(chunk);
            entityManager.EntityComponentStore->DeallocateManagedComponents(chunk, 0, count);

            chunk->Archetype->EntityCount -= chunk->Count;
            entityManager.EntityComponentStore->FreeEntities(chunk);

            entityManager.EntityComponentStore->SetChunkCountKeepMetaChunk(chunk, 0);

            entityManager.ManagedComponentStore.Playback(ref entityManager.EntityComponentStore->ManagedChangesTracker);
        }
Exemplo n.º 2
0
        static void DestroyChunkForDiffing(EntityManager entityManager, Chunk *chunk)
        {
            var access = entityManager.GetCheckedEntityDataAccess();
            var ecs    = access->EntityComponentStore;
            var mcs    = access->ManagedComponentStore;

            var count = chunk->Count;

            ChunkDataUtility.DeallocateBuffers(chunk);
            ecs->DeallocateManagedComponents(chunk, 0, count);

            chunk->Archetype->EntityCount -= chunk->Count;
            ecs->FreeEntities(chunk);

            ChunkDataUtility.SetChunkCountKeepMetaChunk(chunk, 0);

            mcs.Playback(ref ecs->ManagedChangesTracker);
        }
Exemplo n.º 3
0
            public void Execute()
            {
                var access = EntityManager.GetCheckedEntityDataAccess();
                var ecs    = access->EntityComponentStore;

                for (var i = 0; i < Chunks.Length; i++)
                {
                    var chunk = Chunks[i].m_Chunk;
                    var count = chunk->Count;
                    ChunkDataUtility.DeallocateBuffers(chunk);
                    ecs->DeallocateManagedComponents(chunk, 0, count);

                    chunk->Archetype->EntityCount -= chunk->Count;
                    ecs->FreeEntities(chunk);

                    ChunkDataUtility.SetChunkCountKeepMetaChunk(chunk, 0);
                }
            }