diff --git a/Source/MonoGame.Extended.Entities/EntityComponentSystem.cs b/Source/MonoGame.Extended.Entities/EntityComponentSystem.cs index e4b87010..1d4a2b4b 100644 --- a/Source/MonoGame.Extended.Entities/EntityComponentSystem.cs +++ b/Source/MonoGame.Extended.Entities/EntityComponentSystem.cs @@ -54,7 +54,6 @@ namespace MonoGame.Extended.Entities EntityManager = new EntityManager(_systemManager, _dependencyResolver); } - // don't call this every frame, lol public void Scan(params Assembly[] assemblies) { var exportedTypes = assemblies @@ -210,13 +209,13 @@ namespace MonoGame.Extended.Entities if (systemAttribute == null) return; - var system = _dependencyResolver.Resolve(typeInfo.AsType()); - var processingSystem = system as EntityProcessingSystem; + var processingSystem = _dependencyResolver.Resolve(typeInfo.AsType()); + var entityProcessingSystem = processingSystem as EntityProcessingSystem; - if (processingSystem != null) - processingSystem.Aspect = new Aspect(andMask, orMask, norMask); + if (entityProcessingSystem != null) + entityProcessingSystem.Aspect = new Aspect(andMask, orMask, norMask); - _systemManager.AddSystem(system, systemAttribute.GameLoopType, systemAttribute.Layer, SystemExecutionType.Synchronous); + _systemManager.AddSystem(processingSystem, systemAttribute.GameLoopType, systemAttribute.Layer, SystemExecutionType.Synchronous); } } diff --git a/Source/MonoGame.Extended.Entities/SystemManager.cs b/Source/MonoGame.Extended.Entities/SystemManager.cs index 15a1010e..c15ffd69 100644 --- a/Source/MonoGame.Extended.Entities/SystemManager.cs +++ b/Source/MonoGame.Extended.Entities/SystemManager.cs @@ -37,7 +37,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Numerics; using Microsoft.Xna.Framework; using MonoGame.Extended.Collections;