mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-19 02:24:37 +08:00
add EcsWorld.Destroy checks
This commit is contained in:
parent
7f3c2d05c6
commit
c680252868
@ -162,8 +162,13 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
if (_isDestroyed)
|
if (_isDestroyed)
|
||||||
{
|
{
|
||||||
|
EcsDebug.PrintWarning("The world is already destroyed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(id == NULL_WORLD_ID)
|
||||||
|
{
|
||||||
|
Throw.World_WorldCantBeDestroyed();
|
||||||
|
}
|
||||||
_listeners.InvokeOnWorldDestroy();
|
_listeners.InvokeOnWorldDestroy();
|
||||||
_entityDispenser = null;
|
_entityDispenser = null;
|
||||||
_pools = null;
|
_pools = null;
|
||||||
|
@ -103,12 +103,15 @@ namespace DCFApixels.DragonECS.Internal
|
|||||||
{
|
{
|
||||||
throw new EcsFrameworkException($"An entity with identifier {entityID} is already contained in this world");
|
throw new EcsFrameworkException($"An entity with identifier {entityID} is already contained in this world");
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||||
public static void World_PoolAlreadyCreated()
|
public static void World_PoolAlreadyCreated()
|
||||||
{
|
{
|
||||||
throw new EcsFrameworkException("The pool has already been created.");
|
throw new EcsFrameworkException("The pool has already been created.");
|
||||||
}
|
}
|
||||||
|
public static void World_WorldCantBeDestroyed()
|
||||||
|
{
|
||||||
|
throw new EcsFrameworkException("This world can't be destroyed");
|
||||||
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||||
internal static void Ent_ThrowIsNotAlive(entlong entity)
|
internal static void Ent_ThrowIsNotAlive(entlong entity)
|
||||||
|
Loading…
Reference in New Issue
Block a user