Using any Particle-related jobsystem interfaces (IJobParticleSystemParallelForBatch, IJobParticleSystemParallelFor) will cause the system to freeze。
for example:
[BurstCompile]
public struct UpdateParticlesJob : IJobParticleSystemParallelForBatch
{
public void Execute(ParticleSystemJobData particles, int startIndex, int count)
{
}
}
var p = GetComponent<ParticleSystem>();
UpdateParticlesJob job = new UpdateParticlesJob();
job.ScheduleBatch(p, 100);
Where are you calling this from? Particle jobs need to be called from specific Unity callbacks, i.e. OnParticleUpdateJobScheduled().
You can’t just schedule them in update/lateupdate etc.
Whoa, you can do this? Would you be kind enough to send the link to the documentation?
Thank you very much, you are right, I used the wrong method. Everything worked fine after using OnParticleUpdateJobScheduled. However, incorrect usage should not lead to a Unity crash. In fact, this did not happen in 2021.
Thank you for your response. I have found the reason; it was because they were not being called in the correct place.