private void StartParticleSystems() { foreach (ParticleSystem p in gameObject.GetComponentsInChildren <ParticleSystem>()) { if (ManualParticleSystems == null || ManualParticleSystems.Length == 0 || System.Array.IndexOf(ManualParticleSystems, p) < 0) { if (p.main.startDelay.constant == 0.0f) { // wait until next frame because the transform may change var m = p.main; var d = p.main.startDelay; d.constant = 0.01f; m.startDelay = d; } else if (firing.GetShouldWait()) { var m = p.main; var d = p.main.startDelay; d.constant = 1.5f; m.startDelay = d; } p.Play(); } } }