Need to activate GameObject when key is pressed, but then deactivate and reactivate it again when the same button is pressed a second time.

Hello,

I have been trying to figure this thing out but I’m fairly new to coding so please bare with me if this is obvious. What I am trying to do is have a particle system run when the shift key is pressed, and then deactivate and reactivate it again once it is pressed a second time. It is supposed to act like a rocketboost from a jetpack strapped to the main character’s back. My current code is written below, but obviously it isn’t working as intended, since if I let go of the shift key and start moving around, the particles will vanish as well. The best solution would of course be able to have the particles stay until they die out, but I am not sure how I would even begin to code that. So if anyone could point me in the right direction, I’d very much appreciate it.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RocketSmoke : MonoBehaviour
{
	// Use this for initialization
	void Start ()
	{

	}

	// Update is called once per frame
	void Update ()
	{
		foreach (Transform rocketSmoke in this.transform)
		{
			if (Input.GetKey("left shift"))
			{
				rocketSmoke.gameObject.SetActive(true);
			}
			else if (!Input.GetKey("left shift") && !Mathf.Approximately(0.0f, Input.GetAxisRaw("Horizontal")) || !Mathf.Approximately(0.0f, Input.GetAxisRaw("Vertical")))
			{
				rocketSmoke.gameObject.SetActive(false);
			}
		}
	}
}

Wow, I feel like an idiot now, but thank you so much for pointing out the obvious. ^^

EDIT: Positive7 provided the answer I was searching for in the comment below, so have edited the script since. Thank you Positive7.

Ok I managed to figure out how to get what I originally intended, through a different way than using gameObject. But now I am faced with a new problem. I decided to go with having two particle systems switch through states, but for some reason it will never go from the first state to the second. I have provided the code below.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RocketSmoke : MonoBehaviour
{
	public ParticleSystem rocketParticle;
	public ParticleSystem rocketParticle2;
	public string rocketState;

	// Use this for initialization
	void Start ()
	{
		rocketState = "rocket1";
	}

	// Update is called once per frame
	void Update ()
	{
		if (rocketState == "rocket1") {
			
			if (Input.GetKeyDown ("left shift")) {
				rocketParticle.Play ();

			} else if (Input.GetKeyUp ("left shift") ) {
				rocketParticle.Stop ();
				rocketState = "rocket2";
			}
		}
		else if (rocketState == "rocket2") {

			if (Input.GetKey ("left shift")) {
				rocketParticle2.Play ();

			} else if (Input.GetKeyUp ("left shift") ) {
				rocketParticle2.Stop ();
				rocketState = "rocket1";
			}
		}
	}
}