From cfcd2d131a86b3ef473eafc37ee54af797fa9530 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Tue, 21 Nov 2023 10:43:02 +0800 Subject: [PATCH] add entlong.NewUnsafe --- src/entlong.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/entlong.cs b/src/entlong.cs index ab56ba7..8ccdfd8 100644 --- a/src/entlong.cs +++ b/src/entlong.cs @@ -95,6 +95,12 @@ namespace DCFApixels.DragonECS { this.full = full; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe entlong NewUnsafe(long id, long gen, long world) + { + long x = id << 48 | gen << 32 | id; + return *(entlong*)&x; + } #endregion #region TryGetters