diff --git a/Svelto.ECS/EnginesRoot.Engines.cs b/Svelto.ECS/EnginesRoot.Engines.cs index 45c4c50..3d0f0ae 100644 --- a/Svelto.ECS/EnginesRoot.Engines.cs +++ b/Svelto.ECS/EnginesRoot.Engines.cs @@ -47,10 +47,10 @@ namespace Svelto.ECS try { if (engine is IReactOnAddAndRemove viewEngine) - CheckEntityViewsEngine(viewEngine, _reactiveEnginesAddRemove); + CheckEntityViewsEngine(viewEngine, _reactiveEnginesAddRemove); if (engine is IReactOnSwap viewEngineSwap) - CheckEntityViewsEngine(viewEngineSwap, _reactiveEnginesSwap); + CheckEntityViewsEngine(viewEngineSwap, _reactiveEnginesSwap); _enginesSet.Add(engine); @@ -73,13 +73,13 @@ namespace Svelto.ECS } } - void CheckEntityViewsEngine(IEngine engine, Dictionary> engines) + void CheckEntityViewsEngine(IEngine engine, Dictionary> engines) { var interfaces = engine.GetType().GetInterfaces(); foreach (var interf in interfaces) { - if (interf.IsGenericTypeEx() && typeof(IReactEngine).IsAssignableFrom(interf)) + if (interf.IsGenericTypeEx() && typeof(T).IsAssignableFrom(interf)) { var genericArguments = interf.GetGenericArgumentsEx(); diff --git a/Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs b/Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs index 4f40fad..8fc3ade 100644 --- a/Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs +++ b/Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs @@ -126,7 +126,7 @@ namespace Svelto.ECS if (_entitiesOperations.TryGetValue((ulong) entitySubmitOperation.fromID, out var entitySubmitedOperation) == true) { if (entitySubmitedOperation != entitySubmitOperation) - Console.LogError("Only one entity operation per submission is allowed".FastConcat(" entityViewType: ") + throw new ECSException("Only one entity operation per submission is allowed".FastConcat(" entityViewType: ") .FastConcat(typeof(T).Name) .FastConcat(" submission type ", entitySubmitOperation.type.ToString(), " from ID: ", entitySubmitOperation.fromID.entityID.ToString()) diff --git a/Svelto.ECS/EnginesRoot.Submission.cs b/Svelto.ECS/EnginesRoot.Submission.cs index 1ed6b26..a2285f0 100644 --- a/Svelto.ECS/EnginesRoot.Submission.cs +++ b/Svelto.ECS/EnginesRoot.Submission.cs @@ -56,7 +56,7 @@ namespace Svelto.ECS } catch (Exception e) { - var str = "Crash while executing Entity Operation" + var str = "Crash while executing Entity Operation " .FastConcat(entitiesOperations[i].type.ToString()); #if RELAXED_ECS && !PROFILER Console.LogException(str.FastConcat(" "