mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-17 17:34:36 +08:00
update Unpack
This commit is contained in:
parent
330261b971
commit
6f30b5de97
@ -318,7 +318,7 @@ namespace DCFApixels.DragonECS
|
||||
Array.Resize(ref _dense, ArrayUtility.NormalizeSizeToPowerOfTwo_ClampOverflow(minSize));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region CopyFrom/Clone/Slice/ToSpan/ToArray
|
||||
|
@ -1,6 +1,5 @@
|
||||
using DCFApixels.DragonECS.Internal;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
@ -671,7 +670,7 @@ namespace DCFApixels.DragonECS
|
||||
if ((chunk & bit) != 0)
|
||||
{
|
||||
itemsCount--;
|
||||
if(count > componentIDs.Length)
|
||||
if (count > componentIDs.Length)
|
||||
{
|
||||
Array.Resize(ref componentIDs, count << 1);
|
||||
}
|
||||
|
@ -125,6 +125,12 @@ namespace DCFApixels.DragonECS
|
||||
world = EcsWorld.GetWorld(this.world);
|
||||
id = this.id;
|
||||
}
|
||||
public void Unpack(out int id, out short gen, out EcsWorld world)
|
||||
{
|
||||
world = EcsWorld.GetWorld(this.world);
|
||||
gen = this.gen;
|
||||
id = this.id;
|
||||
}
|
||||
public void Unpack(out int id, out int worldID)
|
||||
{
|
||||
worldID = world;
|
||||
@ -142,6 +148,13 @@ namespace DCFApixels.DragonECS
|
||||
id = this.id;
|
||||
return IsAlive;
|
||||
}
|
||||
public bool TryUnpack(out int id, out short gen, out EcsWorld world)
|
||||
{
|
||||
world = EcsWorld.GetWorld(this.world);
|
||||
gen = this.gen;
|
||||
id = this.id;
|
||||
return IsAlive;
|
||||
}
|
||||
public bool TryUnpack(out int id, out int worldID)
|
||||
{
|
||||
worldID = world;
|
||||
|
Loading…
Reference in New Issue
Block a user