diff --git a/src/EcsMask.cs b/src/EcsMask.cs index fcc4220..de60db7 100644 --- a/src/EcsMask.cs +++ b/src/EcsMask.cs @@ -620,7 +620,7 @@ namespace DCFApixels.DragonECS // Поэтому исключающее ограничение игнорируется для maxEntites. return maxEntites; } - private unsafe bool TryFindEntityStorage(out IEntityStorage storage) + private unsafe bool TryGetEntityStorage(out IEntityStorage storage) { if (_isHasAnyEntityStorage) { @@ -746,7 +746,7 @@ namespace DCFApixels.DragonECS { return new Enumerator(_span.Slice(0, 0), _iterator); } - if (_iterator.TryFindEntityStorage(out IEntityStorage storage)) + if (_span.IsSourceEntities && _iterator.TryGetEntityStorage(out IEntityStorage storage)) { return new Enumerator(storage.ToSpan(), _iterator); } @@ -886,7 +886,7 @@ namespace DCFApixels.DragonECS { return new Enumerator(_span.Slice(0, 0), _iterator); } - if (_iterator.TryFindEntityStorage(out IEntityStorage storage)) + if (_span.IsSourceEntities && _iterator.TryGetEntityStorage(out IEntityStorage storage)) { return new Enumerator(storage.ToSpan(), _iterator); } diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index 35ca962..1810d02 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -133,11 +133,7 @@ namespace DCFApixels.DragonECS public EcsSpan Entities { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReleaseDelEntityBufferAll(); - return GetCurrentEntities_Internal(); - } + get { return ToSpan(); } } public int PoolsCount { @@ -459,7 +455,7 @@ namespace DCFApixels.DragonECS { ReleaseDelEntityBufferAll(); } - return _entityDispenser.UsedToEcsSpan(ID); + return GetCurrentEntities_Internal(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe entlong GetEntityLong(int entityID)