mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2026-04-22 01:45:55 +08:00
improve entities cleanup
This commit is contained in:
parent
db6b1d209a
commit
6452850ff8
@ -234,14 +234,14 @@ namespace DCFApixels.DragonECS
|
|||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = Entities.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
DelEntity(Entities[i]);
|
||||||
|
}
|
||||||
|
|
||||||
_isDestroyed = true;
|
_isDestroyed = true;
|
||||||
_listeners.InvokeOnWorldDestroy();
|
_listeners.InvokeOnWorldDestroy();
|
||||||
foreach (var e in Entities)
|
|
||||||
{
|
|
||||||
var count = GetComponentTypeIDsFor_Internal(e, ref _componentIDsBuffer);
|
|
||||||
var span = _componentIDsBuffer.AsSpan(0, count);
|
|
||||||
RemoveComponents(e, span);
|
|
||||||
}
|
|
||||||
_entityDispenser = null;
|
_entityDispenser = null;
|
||||||
_pools = null;
|
_pools = null;
|
||||||
_nullPool = null;
|
_nullPool = null;
|
||||||
@ -259,7 +259,6 @@ namespace DCFApixels.DragonECS
|
|||||||
//_entities - не обнуляется для работы entlong.IsAlive
|
//_entities - не обнуляется для работы entlong.IsAlive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//public void Clear() { }
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Getters
|
#region Getters
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user