This commit is contained in:
DCFApixels 2025-05-15 11:25:18 +08:00
parent ac8bbf2d73
commit ea311afba2
2 changed files with 5 additions and 9 deletions

View File

@ -620,7 +620,7 @@ namespace DCFApixels.DragonECS
// Поэтому исключающее ограничение игнорируется для maxEntites. // Поэтому исключающее ограничение игнорируется для maxEntites.
return maxEntites; return maxEntites;
} }
private unsafe bool TryFindEntityStorage(out IEntityStorage storage) private unsafe bool TryGetEntityStorage(out IEntityStorage storage)
{ {
if (_isHasAnyEntityStorage) if (_isHasAnyEntityStorage)
{ {
@ -746,7 +746,7 @@ namespace DCFApixels.DragonECS
{ {
return new Enumerator(_span.Slice(0, 0), _iterator); 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); return new Enumerator(storage.ToSpan(), _iterator);
} }
@ -886,7 +886,7 @@ namespace DCFApixels.DragonECS
{ {
return new Enumerator(_span.Slice(0, 0), _iterator); 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); return new Enumerator(storage.ToSpan(), _iterator);
} }

View File

@ -133,11 +133,7 @@ namespace DCFApixels.DragonECS
public EcsSpan Entities public EcsSpan Entities
{ {
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get get { return ToSpan(); }
{
ReleaseDelEntityBufferAll();
return GetCurrentEntities_Internal();
}
} }
public int PoolsCount public int PoolsCount
{ {
@ -459,7 +455,7 @@ namespace DCFApixels.DragonECS
{ {
ReleaseDelEntityBufferAll(); ReleaseDelEntityBufferAll();
} }
return _entityDispenser.UsedToEcsSpan(ID); return GetCurrentEntities_Internal();
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe entlong GetEntityLong(int entityID) public unsafe entlong GetEntityLong(int entityID)