From e7ff0685bb896c3673b50296cc0edb719c6e74cc Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:13:10 +0800 Subject: [PATCH] Update AutoEntityCreator.cs --- src/Connectors/AutoEntityCreator.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Connectors/AutoEntityCreator.cs b/src/Connectors/AutoEntityCreator.cs index 9043695..2475ceb 100644 --- a/src/Connectors/AutoEntityCreator.cs +++ b/src/Connectors/AutoEntityCreator.cs @@ -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)