Beispiel #1
0
        private void AddSystem(BaseSystem system)
        {
            systems.Add(system);

            system.EntityWorld   = entityWorld;
            system.EntityFactory = entityFactory;
            system.EventBus      = eventBus;
            system.InputSystem   = inputSystem;

            IEnumerable <Type> requiredTypes = system.RequiredComponents;

            if (requiredTypes != null && requiredTypes.Count() > 0)
            {
                system.Aspect = entityWorld.CreateAspect(system.RequiredComponents);
            }
            system.Added();

            systemUpdateTasks.Add(new SystemUpdateTask(system));
        }