C# Disable all the particles under a tranform

Hi there,

I’m new to Unity trying to figure out how to disable all the particleSystem under a transform. I know I can just do setActive with the gameObject but somehow if I do that the particles doesn’t seems to reset so I want to try disable all the children and re-activate it again.

TransformA    
    -somenodeWithParticle1   
    -somenodeWithParticle2

=============================================================================

ParticleSystem[] particleSystems = SomeGameObject.GetComponentsInChildren<ParticleSystem>();
foreach (ParticleSystem particleSystem in particleSystems)
{
    Debug.Log(particleSystem);
    //nothing print?
}

I just tested it in my project and the following code works for me. I tested with multiple nesting situations as well.

var particleSystems = transform.GetComponentsInChildren<ParticleSystem>();
foreach (var ps in particleSystems)
{
    Debug.Log("Particle System: " + ps.name);
    //Reset or whatever here
}

Is it possible that you are targeting the wrong object? I suggest double checking your references just in case.