mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-19 02:24:37 +08:00
Update MaskQueryExecutor.cs
This commit is contained in:
parent
c57c2d3f94
commit
c4109b010c
@ -109,6 +109,7 @@ namespace DCFApixels.DragonECS.Core
|
|||||||
// [-> _maskInc.Length] inc versions
|
// [-> _maskInc.Length] inc versions
|
||||||
// [-> _maskExc.Length] exc versions
|
// [-> _maskExc.Length] exc versions
|
||||||
private readonly long* _versions;
|
private readonly long* _versions;
|
||||||
|
private readonly int _count;
|
||||||
public long Version
|
public long Version
|
||||||
{
|
{
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
@ -120,7 +121,8 @@ namespace DCFApixels.DragonECS.Core
|
|||||||
_world = mask.World;
|
_world = mask.World;
|
||||||
_maskInc = mask._incs;
|
_maskInc = mask._incs;
|
||||||
_maskExc = mask._excs;
|
_maskExc = mask._excs;
|
||||||
_versions = UnmanagedArrayUtility.NewAndInit<long>(1 + mask._incs.Length + mask._excs.Length);
|
_count = 1 + mask._incs.Length + mask._excs.Length;
|
||||||
|
_versions = UnmanagedArrayUtility.NewAndInit<long>(_count);
|
||||||
}
|
}
|
||||||
public bool Check()
|
public bool Check()
|
||||||
{
|
{
|
||||||
@ -176,7 +178,7 @@ namespace DCFApixels.DragonECS.Core
|
|||||||
|
|
||||||
long* ptr = _versions;
|
long* ptr = _versions;
|
||||||
var slots = _world._poolSlots;
|
var slots = _world._poolSlots;
|
||||||
bool result = _maskInc.Length > 0 || _maskExc.Length > 0;
|
bool result = _count != 1;
|
||||||
foreach (var slotIndex in _maskInc)
|
foreach (var slotIndex in _maskInc)
|
||||||
{
|
{
|
||||||
ptr++;
|
ptr++;
|
||||||
|
Loading…
Reference in New Issue
Block a user