diff --git a/DragonECS.csproj b/DragonECS.csproj index 073cb45..41358e5 100644 --- a/DragonECS.csproj +++ b/DragonECS.csproj @@ -10,7 +10,7 @@ DCFApixels.DragonECS DragonECS - 0.9.8 + 0.9.9 DCFApixels ECS Framework for Game Engines with C# and .Net Platform DCFApixels diff --git a/package.json b/package.json index e687b50..fcffa56 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "displayName": "DragonECS", "description": "C# Entity Component System Framework", "unity": "2020.3", - "version": "0.9.8", + "version": "0.9.9", "repository": { "type": "git", "url": "https://github.com/DCFApixels/DragonECS.git" 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) {