mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2026-04-22 01:45:55 +08:00
update pool applay method
This commit is contained in:
parent
3914fca7f7
commit
3127af7371
@ -390,6 +390,11 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
pool.TryAddOrGet(entityID) = component;
|
pool.TryAddOrGet(entityID) = component;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public static ref T Apply(short worldID, int entityID)
|
||||||
|
{
|
||||||
|
return ref EcsWorld.GetPoolInstance<EcsPool<T>>(worldID).TryAddOrGet(entityID);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -331,6 +331,13 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
pool.TryAdd(entityID);
|
pool.TryAdd(entityID);
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public static ref T Apply(short worldID, int entityID)
|
||||||
|
{
|
||||||
|
var pool = EcsWorld.GetPoolInstance<EcsTagPool<T>>(worldID);
|
||||||
|
pool.TryAdd(entityID);
|
||||||
|
return ref pool._fakeComponent;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -397,6 +397,11 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
pool.TryAddOrGet(entityID) = component;
|
pool.TryAddOrGet(entityID) = component;
|
||||||
}
|
}
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public static ref T Apply(short worldID, int entityID)
|
||||||
|
{
|
||||||
|
return ref EcsWorld.GetPoolInstance<EcsValuePool<T>>(worldID).TryAddOrGet(entityID);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user