#how to config a update filter in unity ecs

1 messages · Page 1 of 1 (latest)

last wraith
#

hi i 'm coding a server-client system, in unity ecs netcode has WorldUpdateFilter allow the system only update in exacly world. So how to do the same in custom world.

lavish grove
#

Set the system you want to update in to [DisableAutoCreation]. Then when creating your custom world, use world.CreateSystem<>() which will properly place the system in the group you specified (in addition to [DisableAutoCreation] attribute).

last wraith
#

wow, nice solution

#

so there is no atr solution for this right

remote shuttle
#

You could implement your attribute and pass enum or string and then while creating world collect all system types and filter them by concrete world

green copper
#

rather than CreateSystem, when creating a custom world with ICustomBootstrap i think it's a bit better to use DefaultWorldInitialization.GetAllSystemTypeIndices to get your list of systems, add your system type indices to the list, and then use TypeManager.SortSystemsInCreationOrder to sort them by CreateAfter/CreateBefore attribute, and then DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups