//Locking the player into a room and spawning enemies
    void SealRoom()
    {
        roomActivated = true;

        foreach (GameObject go in roomDoors)
        {
            foreach (BoxCollider boxCol in go.GetComponents <BoxCollider>())
            {
                if (boxCol.isTrigger)
                {
                    boxCol.enabled = false;
                }
                else
                {
                    boxCol.enabled = true;
                }
            }
            go.GetComponent <MeshRenderer>().enabled    = true;
            go.GetComponent <NavMeshObstacle>().enabled = true;
            go.GetComponent <RoomDoorScript>().enabled  = false;
            //Putting Door on Environment layer
            go.layer = 14;
        }

        cam.SetNewTarget(transform, (Vector3.forward * -5));
        //Deactivate the room mask revealer
        ShaderPositionUpdate.SetRevealer(false);

        StartCoroutine(shootingScript.Recall());
        moveScript.LockHover(true);

        StartCoroutine(SpawnEnemies());
    }
    IEnumerator OpenBossDoor()
    {
        GetComponent <MeshRenderer>().enabled    = false;
        GetComponent <BoxCollider>().enabled     = false;
        GetComponent <NavMeshObstacle>().enabled = false;

        audSource.clip = clips[1];
        audSource.Play();

        //Deactivate player movement
        GameObject player = GameObject.FindWithTag("Player");

        player.GetComponent <Player_Input>().input_Enabled = false;
        player.GetComponent <NavMeshAgent>().enabled       = false;
        player.GetComponent <CapsuleCollider>().enabled    = false;

        ShaderPositionUpdate.SetRevealer(false);

        //Fading Out
        StartCoroutine(fadeScript.FadeOut());
        yield return(new WaitForSeconds(fadeScript.GetFadeTime()));


        //Move player
        player.transform.position = bossRoomSpawnPoint.position;

        player.GetComponent <Player_Input>().input_Enabled = true;
        player.GetComponent <NavMeshAgent>().enabled       = true;
        player.GetComponent <CapsuleCollider>().enabled    = true;

        Transform cam = GameObject.FindWithTag("MainCamera").transform;

        cam.position = new Vector3(player.transform.position.x, cam.position.y, player.transform.position.z);

        //Fading In
        StartCoroutine(fadeScript.FadeIn());
        yield return(new WaitForSeconds(fadeScript.GetFadeTime()));

        //StartCoroutine(levMan.DisplayMessage("Level Completed"));
    }
    //Unlocking the room after all enemies defeated
    void UnlockRoom()
    {
        foreach (GameObject go in roomDoors)
        {
            go.GetComponent <MeshRenderer>().enabled    = false;
            go.GetComponent <BoxCollider>().enabled     = false;
            go.GetComponent <NavMeshObstacle>().enabled = false;
            //Putting Door on Ignore Raycast layer
            go.layer = 2;
        }

        SetRoomCleared();

        cam.SetTargetToPlayer();
        //Reactivate the room mask revealer
        ShaderPositionUpdate.SetRevealer(true);

        StartCoroutine(shootingScript.Recall());
        moveScript.LockHover(false);

        if (isBossKeyRoom)
        {
            roomGen.SpawnChest(true);
        }
        else if (isChestRoom)
        {
            roomGen.SpawnChest(false);
        }
        else
        {
            if (levGen.Roll(levMan.chanceToSpawnHealthRegen))
            {
                roomGen.SpawnHealthRegen();
                levMan.AddHealthRegen();
            }
        }
    }