diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index f64521a..84a3375 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -116,6 +116,8 @@ namespace DCFApixels.DragonECS [MethodImpl(MethodImplOptions.AggressiveInlining)] public ref T Get() where T : struct => ref WorldComponentPool.GetForWorld(id); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ref T UncheckedGet() where T : struct => ref WorldComponentPool.UncheckedGetForWorld(id); #endregion #region Where Query diff --git a/src/EcsWorld.static.cs b/src/EcsWorld.static.cs index c131c80..91b36be 100644 --- a/src/EcsWorld.static.cs +++ b/src/EcsWorld.static.cs @@ -57,6 +57,8 @@ namespace DCFApixels.DragonECS public static ref T Get(int itemIndex) => ref _items[itemIndex]; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ref T GetForWorld(int worldID) => ref _items[GetItemIndex(worldID)]; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref T UncheckedGetForWorld(int worldID) => ref _items[_mapping[worldID]]; public static int GetItemIndex(int worldID) { if (_mapping.Length < Worlds.Length) @@ -79,7 +81,6 @@ namespace DCFApixels.DragonECS } return itemIndex; } - private static void Release(int worldID) { ref short itemIndex = ref _mapping[worldID];