From 5ca6802ae90ec83fe139600121befbab6471dfe9 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Sun, 3 Mar 2024 00:28:02 +0800 Subject: [PATCH] update Unpack --- src/entlong.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/entlong.cs b/src/entlong.cs index 6f22edd..b0b7195 100644 --- a/src/entlong.cs +++ b/src/entlong.cs @@ -120,28 +120,41 @@ namespace DCFApixels.DragonECS worldID = world; return IsAlive; } - public void Unpack(out EcsWorld world, out int id) + public void Unpack(out int id, out EcsWorld world) { world = EcsWorld.GetWorld(this.world); id = this.id; } - public void Unpack(out int worldID, out int id) + public void Unpack(out int id, out int worldID) { worldID = world; id = this.id; } - public bool TryUnpack(out EcsWorld world, out int id) + public void Unpack(out int id, out short gen, out short worldID) + { + worldID = world; + gen = this.gen; + id = this.id; + } + public bool TryUnpack(out int id, out EcsWorld world) { world = EcsWorld.GetWorld(this.world); id = this.id; return IsAlive; } - public bool TryUnpack(out int worldID, out int id) + public bool TryUnpack(out int id, out int worldID) { worldID = world; id = this.id; return IsAlive; } + public bool TryUnpack(out int id, out short gen, out short worldID) + { + worldID = world; + gen = this.gen; + id = this.id; + return IsAlive; + } #endregion #region Operators