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 #endregion
#region Other #region Other
public static void ClearCache()
{
lock (_lock)
{
_metaCache.Clear();
_metaCache.Add(typeof(void), NullTypeMeta);
}
}
ITypeMeta ITypeMeta.BaseMeta ITypeMeta ITypeMeta.BaseMeta
{ {
get { return null; } get { return null; }

View File

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

View File

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

View File

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

View File

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