fix world id management

This commit is contained in:
Mikhail 2024-09-10 09:29:08 +08:00
parent bc1075eada
commit 7cf6894476

View File

@ -153,6 +153,10 @@ namespace DCFApixels.DragonECS
if (itemIndex != 0) if (itemIndex != 0)
{ {
_interface.OnDestroy(ref _items[itemIndex], _worlds[worldID]); _interface.OnDestroy(ref _items[itemIndex], _worlds[worldID]);
if(_recycledItemsCount >= _recycledItems.Length)
{
Array.Resize(ref _recycledItems, _recycledItems.Length << 1);
}
_recycledItems[_recycledItemsCount++] = itemIndex; _recycledItems[_recycledItemsCount++] = itemIndex;
itemIndex = 0; itemIndex = 0;
} }