diff --git a/src/Pools/EcsPool.cs b/src/Pools/EcsPool.cs index 0a7a87b..bb611c7 100644 --- a/src/Pools/EcsPool.cs +++ b/src/Pools/EcsPool.cs @@ -390,6 +390,11 @@ namespace DCFApixels.DragonECS { pool.TryAddOrGet(entityID) = component; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref T Apply(short worldID, int entityID) + { + return ref EcsWorld.GetPoolInstance>(worldID).TryAddOrGet(entityID); + } #endregion } diff --git a/src/Pools/EcsTagPool.cs b/src/Pools/EcsTagPool.cs index c2b25ec..b229203 100644 --- a/src/Pools/EcsTagPool.cs +++ b/src/Pools/EcsTagPool.cs @@ -331,6 +331,13 @@ namespace DCFApixels.DragonECS { pool.TryAdd(entityID); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref T Apply(short worldID, int entityID) + { + var pool = EcsWorld.GetPoolInstance>(worldID); + pool.TryAdd(entityID); + return ref pool._fakeComponent; + } #endregion } diff --git a/src/Pools/EcsValuePool.cs b/src/Pools/EcsValuePool.cs index 7b2d355..f97b7eb 100644 --- a/src/Pools/EcsValuePool.cs +++ b/src/Pools/EcsValuePool.cs @@ -397,6 +397,11 @@ namespace DCFApixels.DragonECS { pool.TryAddOrGet(entityID) = component; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref T Apply(short worldID, int entityID) + { + return ref EcsWorld.GetPoolInstance>(worldID).TryAddOrGet(entityID); + } #endregion }