Hi, I'm currently experimenting with the new ECS & Jobs system and I was wondering if there was any way to run a job in a JobComponentSystem over n frames. For example on a simple boid flocking simulation what would be a way to run the movement job every frame and the Steering Job run over 10 frames? Thanks
Code (CSharp): if (Time.frameCount % 10 == 0) { inputDeps= new JobComponentSystem().Schedule(this); }
Thanks, I did not realize we could start a job not depending on another job completion. Your username is perfect.
Just in case, the returned `JobHandle` from `JobComponentSystem`'s `OnUpdate` will be force completed immediately on the next frame. So if you managed to run a job on every 10th frame for example and put that in the line with the dependency chain, the next 11th frame it will be completed. (So not "over" 10 frames but rather every 10 frames + over 1 frame)
Is there a way to start a job (in ecs) and then have the job start itself and have all of this in a way that is not dependent on the update function?
Can't start a job from a job * you kind of can with hacks and unsafe code for very specific circumstances (mostly non Unity related) but if you don't know how you definitely should not be doing this