mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-19 02:24:37 +08:00
fix EcsGroup.ToSpan
This commit is contained in:
parent
06573d0dcb
commit
5ced4c0388
@ -132,13 +132,8 @@ namespace DCFApixels.DragonECS
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public override int GetHashCode() => throw new NotSupportedException();
|
||||
#pragma warning restore CS0809 // Устаревший член переопределяет неустаревший член
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static implicit operator EcsSpan(EcsReadonlyGroup a) => a.ToSpan();
|
||||
//internal class DebuggerProxy : EcsGroup.DebuggerProxy
|
||||
//{
|
||||
// public DebuggerProxy(EcsReadonlyGroup group) : base(group._source) { }
|
||||
//}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@ -327,16 +322,22 @@ namespace DCFApixels.DragonECS
|
||||
{
|
||||
entities.Clear();
|
||||
foreach (var e in this)
|
||||
{
|
||||
entities.Add(e);
|
||||
}
|
||||
}
|
||||
public EcsSpan ToSpan()
|
||||
{
|
||||
return new EcsSpan(WorldID, _dense);
|
||||
return new EcsSpan(WorldID, _dense, 1, _count);
|
||||
}
|
||||
public EcsSpan ToSpan(int start, int length)
|
||||
{
|
||||
start -= 1;
|
||||
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||
if (start + length > _count) Throw.ArgumentOutOfRange();
|
||||
if (start < 0 || start + length > _count)
|
||||
{
|
||||
Throw.ArgumentOutOfRange();
|
||||
}
|
||||
#endif
|
||||
return new EcsSpan(WorldID, _dense, start, length);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user