From 6b42dc07b9578dae61c148a96f84cfa3faaf5981 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Sat, 5 Apr 2025 00:18:50 +0800 Subject: [PATCH] Update entlong.cs --- src/entlong.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/entlong.cs b/src/entlong.cs index d7e64d3..9b25a94 100644 --- a/src/entlong.cs +++ b/src/entlong.cs @@ -147,6 +147,20 @@ namespace DCFApixels.DragonECS return IsAlive; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Unpack(out int id) + { +#if DEBUG + if (IsAlive == false) { Throw.Ent_ThrowIsNotAlive(this); } +#elif DRAGONECS_STABILITY_MODE + if (IsAlive == false) + { + id = EcsConsts.NULL_ENTITY_ID; + return; + } +#endif + id = _id; + } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Unpack(out int id, out EcsWorld world) { @@ -216,6 +230,12 @@ namespace DCFApixels.DragonECS id = _id; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool TryUnpack(out int id) + { + id = _id; + return IsAlive; + } [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool TryUnpack(out int id, out EcsWorld world) {