diff --git a/src/ComponentDepot.cs b/src/ComponentDepot.cs index c908931..8a6b37f 100644 --- a/src/ComponentDepot.cs +++ b/src/ComponentDepot.cs @@ -80,7 +80,7 @@ namespace MoonTools.ECS public void Clear() { - for (var i = 0; i < ComponentTypeIndices.Count; i += 1) + for (var i = 0; i < storages.Length; i += 1) { if (storages[i] != null) { diff --git a/src/RelationDepot.cs b/src/RelationDepot.cs index 67ae436..c22493b 100644 --- a/src/RelationDepot.cs +++ b/src/RelationDepot.cs @@ -145,7 +145,7 @@ namespace MoonTools.ECS public void Clear() { - for (var i = 0; i < RelationTypeIndices.Count; i += 1) + for (var i = 0; i < storages.Length; i += 1) { if (storages[i] != null) {