Merge branch 'pr/8' into dev

This commit is contained in:
Mikhail 2026-03-04 14:01:45 +08:00
commit 8901c4fc83
5 changed files with 19 additions and 8 deletions

View File

@ -370,6 +370,14 @@ namespace DCFApixels.DragonECS
#endregion
#region Other
public static void ClearCache()
{
lock (_lock)
{
_metaCache.Clear();
_metaCache.Add(typeof(void), NullTypeMeta);
}
}
ITypeMeta ITypeMeta.BaseMeta
{
get { return null; }

View File

@ -411,6 +411,10 @@ namespace DCFApixels.DragonECS
#endregion
#region Other
public static void ClearCache()
{
_staticMaskCache.Clear();
}
EcsMask IComponentMask.ToMask(EcsWorld world) { return _mask; }
#endregion

View File

@ -175,10 +175,6 @@ namespace DCFApixels.DragonECS
// тут сложно однозначно посчитать, так как нужно еще место под аспекты и запросы
int controllersCount = config.PoolsCapacity * 4;
_worldComponentPools = new StructList<WorldComponentPoolAbstract>(controllersCount);
if (controllersCount < _allWorldComponentPools.Capacity)
{
_allWorldComponentPools.Capacity = controllersCount;
}
if (worldID < 0 || (worldID == NULL_WORLD_ID && nullWorld == false))
{

View File

@ -147,10 +147,7 @@ namespace DCFApixels.DragonECS
private static short _recycledItemsCount;
private static readonly IEcsWorldComponent<T> _interface = EcsWorldComponentHandler<T>.instance;
private static readonly Abstract _controller = new Abstract();
static WorldComponentPool()
{
_allWorldComponentPools.Add(_controller);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ref T GetItem(int itemIndex)
{// ts

View File

@ -357,6 +357,12 @@ namespace DCFApixels.DragonECS
instance.Inject(_injectedData);
}
}
internal static void Clear()
{
_Empty_Internal._injections.Clear();
_Empty_Internal._nodes.Clear();
}
}
#endregion
}