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