WaitForSeconds not working

I am working with StartCoroutine and IEnumerator and on mouse click I am making a boolean variable true and using StartCoroutine I want to make that variable false after 2 second.But its not working.I am attaching the code here.

using UnityEngine;
using System.Collections;

public class GoldenEgg : MonoBehaviour {

public static bool isGoldenEggClicked = false;

// Use this for initialization
void Start () {
startTime = 20.0f;
}

// Update is called once per frame
void Update () {
//MakeGoldenEggFalse();
}

void OnMouseDown() {
	
	isGoldenEggClicked = true;
	Destroy(transform.gameObject);
	if(isGoldenEggClicked == true) {
		StartCoroutine(MakeGoldenEggFalse());
	}
}

IEnumerator MakeGoldenEggFalse(){
	//Debug.Log("isGoldenEggClicked33 "+isGoldenEggClicked );
	 yield return new WaitForSeconds(2.0f);
	 isGoldenEggClicked = false;
	 Debug.Log("isGoldenEggClicked " + isGoldenEggClicked);
}

}

Your coroutine is tied to the script that called it.

In your case, you destroy the calling object so the coroutine goes with it.

You need to keep your guy on scene until the coroutine is over.

void OnMouseDown() {  
    isGoldenEggClicked = true;
    // Disable renderer and collider 
    // so that your object is not visible and cannot collide
    // Here you should make sure that this cannot be called twice.
    if(isGoldenEggClicked == true) { 
       StartCoroutine(MakeGoldenEggFalse());
    }
}
 
IEnumerator MakeGoldenEggFalse(){
    //Debug.Log("isGoldenEggClicked33 "+isGoldenEggClicked );
     yield return new WaitForSeconds(2.0f);
     isGoldenEggClicked = false;
     Debug.Log("isGoldenEggClicked " + isGoldenEggClicked);
     Destroy(transform.gameObject);
}