mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-17 17:34:36 +08:00
EcsWorld.Destroy implementation
This commit is contained in:
parent
63474c4fdd
commit
abbe33e3b5
@ -43,6 +43,12 @@ namespace DCFApixels.DragonECS
|
|||||||
id = (short)_worldIdDispenser.GetFree();
|
id = (short)_worldIdDispenser.GetFree();
|
||||||
Worlds[id] = (IEcsWorld)this;
|
Worlds[id] = (IEcsWorld)this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void Realeze()
|
||||||
|
{
|
||||||
|
Worlds[id] = null;
|
||||||
|
_worldIdDispenser.Release(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class EcsWorld<TArchetype> : EcsWorld, IEcsWorld
|
public abstract class EcsWorld<TArchetype> : EcsWorld, IEcsWorld
|
||||||
@ -110,7 +116,6 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetFilter
|
#region GetFilter
|
||||||
|
|
||||||
public EcsFilter Filter<TInc>() where TInc : struct, IInc => Filter<TInc, Exc>();
|
public EcsFilter Filter<TInc>() where TInc : struct, IInc => Filter<TInc, Exc>();
|
||||||
public EcsFilter Filter<TInc, TExc>() where TInc : struct, IInc where TExc : struct, IExc
|
public EcsFilter Filter<TInc, TExc>() where TInc : struct, IInc where TExc : struct, IExc
|
||||||
{
|
{
|
||||||
@ -298,7 +303,15 @@ namespace DCFApixels.DragonECS
|
|||||||
#region Destroy
|
#region Destroy
|
||||||
public void Destroy()
|
public void Destroy()
|
||||||
{
|
{
|
||||||
|
_entityDispenser = null;
|
||||||
|
_entities = null;
|
||||||
|
_gens = null;
|
||||||
|
_pools = null;
|
||||||
|
_nullPool = null;
|
||||||
|
_filtersByIncludedComponents = null;
|
||||||
|
_filtersByExcludedComponents = null;
|
||||||
|
_filters = null;
|
||||||
|
Realeze();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user