diff --git a/src/Collections/EcsGroup.cs b/src/Collections/EcsGroup.cs index 8012df1..32e435b 100644 --- a/src/Collections/EcsGroup.cs +++ b/src/Collections/EcsGroup.cs @@ -318,7 +318,7 @@ namespace DCFApixels.DragonECS Array.Resize(ref _dense, ArrayUtility.NormalizeSizeToPowerOfTwo_ClampOverflow(minSize)); } } - + #endregion #region CopyFrom/Clone/Slice/ToSpan/ToArray diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index bdaf99a..ebe9438 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -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); } diff --git a/src/entlong.cs b/src/entlong.cs index b0b7195..5b50180 100644 --- a/src/entlong.cs +++ b/src/entlong.cs @@ -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;