mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-17 17:34:36 +08:00
add EcsWorld.Destroy checks
This commit is contained in:
parent
7f3c2d05c6
commit
c680252868
@ -162,8 +162,13 @@ namespace DCFApixels.DragonECS
|
||||
{
|
||||
if (_isDestroyed)
|
||||
{
|
||||
EcsDebug.PrintWarning("The world is already destroyed");
|
||||
return;
|
||||
}
|
||||
if(id == NULL_WORLD_ID)
|
||||
{
|
||||
Throw.World_WorldCantBeDestroyed();
|
||||
}
|
||||
_listeners.InvokeOnWorldDestroy();
|
||||
_entityDispenser = 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");
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public static void World_PoolAlreadyCreated()
|
||||
{
|
||||
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)]
|
||||
internal static void Ent_ThrowIsNotAlive(entlong entity)
|
||||
|
Loading…
Reference in New Issue
Block a user