#Recreating old ECS functionality in newer versions
1 messages · Page 1 of 1 (latest)
so far I have foreach (var entity in EntityManager.GetAllEntities()) but I'm not sure how I can get access to the params reference
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... }
this is not equal functionality
because he is likely having job there
look at manual and search for IJobEntity
this is replacement
mainstream one
yeah I do have a job there
What do you mean by "a job there"?
actually no, I just double checked and I don't, at least not ran in this code
I thought he meant that I would run a job inside of the foreach
You can run a job in the ForEach Query as well since it's mainthread.
Entities.ForEach used to generate a job
SystemAPI.Query does not
Oh yeah, you right. That was a long time ago. You needed .Run()/.Schedule after a ForEach lambda