mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2026-04-22 01:45:55 +08:00
fix/improve static cleanup
This commit is contained in:
parent
7b75720999
commit
b6ae601cff
@ -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; }
|
||||||
@ -623,13 +631,5 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
internal static void Clear()
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
_metaCache.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -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
|
||||||
|
|
||||||
@ -467,11 +471,6 @@ namespace DCFApixels.DragonECS
|
|||||||
public delegate void OnBuildApectHandler(object aspect, EcsMask mask);
|
public delegate void OnBuildApectHandler(object aspect, EcsMask mask);
|
||||||
public static event OnBuildApectHandler OnAfterInit = delegate { };
|
public static event OnBuildApectHandler OnAfterInit = delegate { };
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
internal static void Clear()
|
|
||||||
{
|
|
||||||
_staticMaskCache.Clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region EcsAspect.Builder.Extensions
|
#region EcsAspect.Builder.Extensions
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
using DCFApixels.DragonECS.Core.Internal;
|
|
||||||
|
|
||||||
namespace DCFApixels.DragonECS
|
|
||||||
{
|
|
||||||
public static class EcsStaticCleaner
|
|
||||||
{
|
|
||||||
public static void ResetAll()
|
|
||||||
{
|
|
||||||
TypeMeta.Clear();
|
|
||||||
Injector.InjectionList.Clear();
|
|
||||||
// MemoryAllocator.Clear();
|
|
||||||
EcsTypeCodeManager.Clear();
|
|
||||||
ConfigContainer.Clear();
|
|
||||||
EcsAspect.Clear();
|
|
||||||
EcsWorld.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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
|
||||||
@ -346,10 +343,5 @@ namespace DCFApixels.DragonECS
|
|||||||
return FindPoolInstance(componentType);
|
return FindPoolInstance(componentType);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
internal static void Clear()
|
|
||||||
{
|
|
||||||
_allWorldComponentPools.Clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -53,11 +53,6 @@ namespace DCFApixels.DragonECS.Core.Internal
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public static IEnumerable<TypeCodeInfo> GetDeclaredTypes() { return _codes.Select(o => new TypeCodeInfo(o.Key, o.Value)); }
|
public static IEnumerable<TypeCodeInfo> GetDeclaredTypes() { return _codes.Select(o => new TypeCodeInfo(o.Key, o.Value)); }
|
||||||
|
|
||||||
internal static void Clear()
|
|
||||||
{
|
|
||||||
_codes.Clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#if ENABLE_IL2CPP
|
#if ENABLE_IL2CPP
|
||||||
[Il2CppSetOption(Option.NullChecks, false)]
|
[Il2CppSetOption(Option.NullChecks, false)]
|
||||||
|
|||||||
@ -102,11 +102,6 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
return GetAllConfigs().GetEnumerator();
|
return GetAllConfigs().GetEnumerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Clear()
|
|
||||||
{
|
|
||||||
Empty._storage.Clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static class ConfigContainerExtensions
|
public static class ConfigContainerExtensions
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user