Particle system that turns on and off automatically in a timed way

I’m looking to create a trap for a maze and there’s a particle system being used as a fire trap that blows fire in the way of the person trying to get through. I want it to turn on and off at different times so th player can get through. How can this goal be achieved?

The simplest way would be using InvokeRepeating.
Example code in C#:

    void Start()
    {
        InvokeRepeating("ToggleParticleSystem", Time, RepeatRate);
    }

    void ToggleParticleSystem()
    {
        myParticleSystem.enableEmission = !myParticleSystem.enableEmission;
    }

To turn off the particles and stop the invoke, you can just write:

myParticleSystem.enableEmission = false;
CancelInvoke("ToggleParticleSystem");