diff --git a/src/Pools/EcsPoolBase.cs b/src/Pools/EcsPoolBase.cs index a34e156..172f933 100644 --- a/src/Pools/EcsPoolBase.cs +++ b/src/Pools/EcsPoolBase.cs @@ -249,6 +249,18 @@ namespace DCFApixels.DragonECS { return self == null || self == EcsNullPool.instance; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref T NewEntity(this IEcsStructPool self) where T : struct + { + var e = self.World.NewEntity(); + return ref self.Add(e); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref T NewEntity(this IEcsStructPool self, out int entityID) where T : struct + { + entityID = self.World.NewEntity(); + return ref self.Add(entityID); + } } #endregion