add warning

This commit is contained in:
Mikhail 2024-04-22 17:16:37 +08:00
parent 9a149da66e
commit 4ace55d4d7

View File

@ -497,11 +497,20 @@ namespace DCFApixels.DragonECS
foreach (var incTypeID in _mask.inc) foreach (var incTypeID in _mask.inc)
{ {
var pool = world.GetPoolInstance(incTypeID); var pool = world.GetPoolInstance(incTypeID);
if (pool != null && pool.Has(entityID) == false) if (pool != null)
{
if (pool.Has(entityID) == false)
{ {
pool.AddRaw(entityID, null); pool.AddRaw(entityID, null);
} }
} }
#if DEBUG
else
{
EcsDebug.PrintWarning("Component has not been added because the pool has not been initialized yet.");
}
}
#endif
foreach (var excTypeID in _mask.exc) foreach (var excTypeID in _mask.exc)
{ {
var pool = world.GetPoolInstance(excTypeID); var pool = world.GetPoolInstance(excTypeID);