mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 09:54:35 +08:00
optimize pools
This commit is contained in:
parent
7de803cc12
commit
93e9a57c5c
@ -189,6 +189,10 @@ namespace DCFApixels.DragonECS
|
|||||||
void IEcsPoolImplementation.OnWorldDestroy() { }
|
void IEcsPoolImplementation.OnWorldDestroy() { }
|
||||||
void IEcsPoolImplementation.OnReleaseDelEntityBuffer(ReadOnlySpan<int> buffer)
|
void IEcsPoolImplementation.OnReleaseDelEntityBuffer(ReadOnlySpan<int> buffer)
|
||||||
{
|
{
|
||||||
|
if (_itemsCount <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
foreach (var entityID in buffer)
|
foreach (var entityID in buffer)
|
||||||
{
|
{
|
||||||
TryDel(entityID);
|
TryDel(entityID);
|
||||||
|
@ -167,6 +167,10 @@ namespace DCFApixels.DragonECS
|
|||||||
|
|
||||||
void IEcsPoolImplementation.OnReleaseDelEntityBuffer(ReadOnlySpan<int> buffer)
|
void IEcsPoolImplementation.OnReleaseDelEntityBuffer(ReadOnlySpan<int> buffer)
|
||||||
{
|
{
|
||||||
|
if (_count <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
foreach (var entityID in buffer)
|
foreach (var entityID in buffer)
|
||||||
{
|
{
|
||||||
TryDel(entityID);
|
TryDel(entityID);
|
||||||
|
Loading…
Reference in New Issue
Block a user