#[Bug?] ProcessAfterLoadGroup bad WorldSystemFilter

1 messages · Page 1 of 1 (latest)

surreal galleon
#
    [DisableAutoCreation]
    [WorldSystemFilter(WorldSystemFilterFlags.ProcessAfterLoad)]
    public partial class ProcessAfterLoadGroup : ComponentSystemGroup
    {
    }```
this should really be
```cs
    [DisableAutoCreation]
    [WorldSystemFilter(WorldSystemFilterFlags.ProcessAfterLoad, WorldSystemFilterFlags.ProcessAfterLoad)]
    public partial class ProcessAfterLoadGroup : ComponentSystemGroup
    {
    }```
so that systems that update in this group are automatically flagged with WorldSystemFilterFlags.ProcessAfterLoad
Took me a while to try figure out why my systems weren't updating as without that change, you must include it yourself which is contrary to your documentation
```cs
    [WorldSystemFilter(WorldSystemFilterFlags.ProcessAfterLoad)]
    [UpdateInGroup(typeof(ProcessAfterLoadGroup))]
    public partial struct RemapObjectIdSystem : ISystem```
#

and your own sample doesn't work because of this

    [UpdateInGroup(typeof(ProcessAfterLoadGroup))]
    public partial struct PostprocessSystem : ISystem
    {
        private EntityQuery offsetQuery;

        public void OnCreate(ref SystemState state)
        {
            offsetQuery = new EntityQueryBuilder(Allocator.Temp)
                .WithAll<PostLoadOffset>()
                .Build(ref state);
            state.RequireForUpdate(offsetQuery);
        }

        public void OnUpdate(ref SystemState state)
        {
            // Query the instance information from the entity created in the EntityCommandBuffer.
            var offsets = offsetQuery.ToComponentDataArray<PostLoadOffset>(Allocator.Temp);
            foreach (var offset in offsets)
            {
                // Use that information to apply the transforms to the entities in the instance.
                foreach (var transform in SystemAPI.Query<RefRW<LocalTransform>>())
                {
                    transform.ValueRW.Position += offset.Offset;
                }
            }
            state.EntityManager.DestroyEntity(offsetQuery);
        }
    }```