Exemple #1
0
        public EcsSystem(EcsWorld world)
        {
            this.world = world;

            // In case this system was created after entities were already created, populate the lists with all matching entities.
            entities = world.GetEntitiesMatchingComponentFilter <TComponentFilter>().ToList();
            filters  = world.CreateComponentFilters <TComponentFilter>(entities).ToList();

            world.OnComponentAdded   += OnComponentAdded;
            world.OnComponentRemoved += OnComponentRemoved;
            world.OnEntityDestroyed  += OnEntityDestroyed;

            Console.WriteLine("Created " + GetType() + " processing " + EntityCount + " entities.");
        }