How do I disable gameobjects in the scene for at lease five or ten seconds in the unity3d

I need to disable the gameobjects in my scene for exactly five seconds or ten seconds because I going to to have an animation countdown playing in my scene. I need to disable the scripts .

public float disableTime = 5f;
private float t = 0f;

void Start() {
     StartCoroutine(DisableGameObjects());
}

private IEnumerator DisableGameObjects() {
     Transform[] transforms = FindObjectsOfType(typeof(Transform)) as Transform[];
     foreach(Transform tr in transforms) {
          tr.gameObject.SetActive(false);
     }
     yield return new WaitForSeconds(disableTime);
     foreach(Transform tr in transforms) {
          tr.gameObject.SetActive(true);
     }

}

Use Gameobject.SetActive(false), or Gameobject.SetActive(true), and use a timer like this, (timeToTake shouldn’t change, it’s how you can reset it,set it to how many seconds you want it to take,i.e.3.2f is 3.2 seconds):

void Update(){

	if (startcountdown){
		timeLeft=timeToTake;//both floats, this resets the timer
		countdown=true;
	}

	if (countdown){
		timeLeft-=Time.deltaTime;
	}
	if (timeLeft<0f){

countdown=false;
//do stuff
}
}