Squashed commit of the following:

commit 6452850ff8
Author: Mikhail <99481254+DCFApixels@users.noreply.github.com>
Date:   Tue Mar 3 14:46:58 2026 +0800

    improve entities cleanup

commit db6b1d209a
Author: Karpik <artem19051664@gmail.com>
Date:   Tue Jan 27 22:46:58 2026 +0400

    Remove components for every entity in world.Destroy()

    In my situation, it invokes IEcsComponentLifecycle<T> methods
This commit is contained in:
Mikhail 2026-03-03 15:04:23 +08:00
parent f15e0b5ed1
commit 9bd7558bdd

View File

@ -234,6 +234,12 @@ namespace DCFApixels.DragonECS
#endif
return;
}
for (int i = Entities.Count - 1; i >= 0; i--)
{
DelEntity(Entities[i]);
}
_isDestroyed = true;
_listeners.InvokeOnWorldDestroy();
_entityDispenser = null;
@ -253,7 +259,6 @@ namespace DCFApixels.DragonECS
//_entities - не обнуляется для работы entlong.IsAlive
}
}
//public void Clear() { }
#endregion
#region Getters