#Recreating old ECS functionality in newer versions

1 messages · Page 1 of 1 (latest)

burnt prairie
#

trying to recreate this line in the new ECS versions, any idea how I can specific the components?

var newParams = new Params...
}
#

so far I have foreach (var entity in EntityManager.GetAllEntities()) but I'm not sure how I can get access to the params reference

wicked scroll
#

You want to set a ComponentData named Params with access to the entity?

#

Wrote this by memory so the actual code might be a little different. foreach ((RefRW<Params> params, Entity entity) in SystemAPI.Query<RefRW<Params>>().WithEntityAccess()) { params.ValueRW = new Params... }

shut lake
#

because he is likely having job there

#

look at manual and search for IJobEntity

#

this is replacement

#

mainstream one

burnt prairie
#

yeah I do have a job there

wicked scroll
#

What do you mean by "a job there"?

burnt prairie
#

actually no, I just double checked and I don't, at least not ran in this code

burnt prairie
wicked scroll
#

You can run a job in the ForEach Query as well since it's mainthread.

shut lake
#

SystemAPI.Query does not

wicked scroll
#

Oh yeah, you right. That was a long time ago. You needed .Run()/.Schedule after a ForEach lambda