Update AutoEntityCreator.cs

This commit is contained in:
Mikhail 2024-10-31 19:13:10 +08:00
parent e5f44eb23a
commit e7ff0685bb

View File

@ -60,23 +60,20 @@ namespace DCFApixels.DragonECS
}
private void CreateEntity()
{
if (_created)
{
return;
}
if (_created) { return; }
if (_world == null)
{
AutoResolveWorldProviderDependensy();
}
else
{
InitConnect(_connect, _world.GetRaw());
}
InitConnect(_connect, _world.GetRaw());
_created = true;
}
private void InitConnect(EcsEntityConnect connect, EcsWorld world)
{
if (connect.IsConnected) { return; }
connect.ConnectWith(CreateEntity(world), true);
}
protected virtual entlong CreateEntity(EcsWorld world)