private void ActivateRoom()
    {
        RoomActive rm = thisroom.GetComponent <RoomActive>();

        rm.roomcomplete = false;
        rm.spawners.SetActive(true);
        rm.player.GetComponent <MoveScript>().roomison = true;
        rm.Doors.SetActive(true);
        StartCoroutine(Wave());
    }
 private void Update()
 {
     if ((player.transform.position - this.transform.position).magnitude <= 5 && isactive == false)
     {
         text.GetComponent <TextMesh>().text = "Press E to accept the challenge";
         if (Input.GetButtonDown("Interact"))
         {
             ActivateRoom();
             GetComponent <SpriteRenderer>().sprite = red;
             isactive = true;
         }
     }
     else if (isactive == false && (player.transform.position - this.transform.position).magnitude <= 5)
     {
         text.SetActive(false);
     }
     else if (isactive == true)
     {
         text.GetComponent <TextMesh>().text = "Time left:" + Mathf.RoundToInt(timer);
         if (isactive && timer >= 0)
         {
             timer -= Time.deltaTime;
         }
         else if (timer <= 0)
         {
             StopAllCoroutines();
             if (zombieCount.transform.childCount == 0)
             {
                 RoomActive rm = thisroom.GetComponent <RoomActive>();
                 isactive        = false;
                 rm.roomcomplete = true;
                 GetComponent <SpriteRenderer>().sprite = green;
                 rm.spawners.SetActive(false);
                 rm.player.GetComponent <MoveScript>().roomison = false;
                 rm.Doors.SetActive(false);
                 text.SetActive(false);
                 GameObject drop = Instantiate(rewards[Random.Range(0, rewards.Length)], transform.position, Quaternion.identity);
                 Destroy(gameObject);
             }
             else
             {
                 text.GetComponent <TextMesh>().text = zombieCount.transform.childCount.ToString() + " Zombies left";
             }
         }
     }
 }