unity player particle sorting layer 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;