public sealed override void Update(float deltaTime, ECSWorld world)
        {
            if (!initialized)
            {
                afterUpdateCommands = new ConcurrentEntityCommandBuffer(world);
                query       = GetQuery();
                filter      = GetComponentFilter();
                initialized = true;
            }
            BeforeUpdate(deltaTime, world);

            afterUpdateCommands.PlaybackAfterUpdate();

            var blocks = world.ComponentManager.GetBlocksNoSync(query, filter);
            var group  = Jobs.StartNewGroup(query);

            foreach (BlockAccessor block in blocks)
            {
                ComponentProcessJob processJob = new ComponentProcessJob()
                {
                    block     = block,
                    deltaTime = deltaTime,
                    instance  = this
                };
                processJob.Schedule(group);
            }
        }
Esempio n. 2
0
 public static void PlaybackAfterUpdate(this ConcurrentEntityCommandBuffer buffer)
 {
     buffer.world.RegisterForExecuteAfterUpdate(buffer);
 }