diff --git a/Svelto.Common b/Svelto.Common index 70c3fa3..5548758 160000 --- a/Svelto.Common +++ b/Svelto.Common @@ -1 +1 @@ -Subproject commit 70c3fa30662f89cd1b023802f114dd917e156d2e +Subproject commit 554875838f1743017981df428243bba80fe3ece1 diff --git a/Svelto.ECS/EnginesRoot.Entities.cs b/Svelto.ECS/EnginesRoot.Entities.cs index 1e7691f..3ba4a9c 100644 --- a/Svelto.ECS/EnginesRoot.Entities.cs +++ b/Svelto.ECS/EnginesRoot.Entities.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using Svelto.DataStructures.Experimental; using Svelto.ECS.Internal; diff --git a/Svelto.ECS/EnginesRoot.Submission.cs b/Svelto.ECS/EnginesRoot.Submission.cs index eb3ce77..8ecd994 100644 --- a/Svelto.ECS/EnginesRoot.Submission.cs +++ b/Svelto.ECS/EnginesRoot.Submission.cs @@ -19,16 +19,14 @@ namespace Svelto.ECS //are there new entities built to process? while ( _newEntitiesBuiltToProcess > 0) { + _newEntitiesBuiltToProcess = 0; //use other as source from now on //current will be use to write new entityViews _groupedEntityToAdd.Swap(); - //Note: if N entity of the same type are added on the same frame - //the Add callback is called N times on the same frame. - //if the Add calback builds a new entity, that entity will not - //be available in the database until the N callbacks are done - //solving it could be complicated as callback and database update - //must be interleaved. + //Note: if N entity of the same type are added on the same frame the Add callback is called N times on + //the same frame. if the Add calback builds a new entity, that entity will not be available in the + //database until the N callbacks are done. if (_groupedEntityToAdd.other.Count > 0) AddEntityViewsToTheDBAndSuitableEngines(_groupedEntityToAdd.other); @@ -38,7 +36,6 @@ namespace Svelto.ECS if (numberOfReenteringLoops > 5) throw new Exception("possible infinite loop found creating Entities inside IEntityViewsEngine Add method, please consider building entities outside IEntityViewsEngine Add method"); - _newEntitiesBuiltToProcess = 0; numberOfReenteringLoops++; } }