how to change the sorting layer of particle system unity code example
Example: unity change particle system sorting layer via script
ParticleSystem myParticleSystem;
myParticleSystem.GetComponent<ParticleSystemRenderer>().sortingOrder = 0;
ParticleSystem myParticleSystem;
myParticleSystem.GetComponent<ParticleSystemRenderer>().sortingOrder = 0;