//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()); }
void SealRoom() { foreach (BoxCollider boxCol in GetComponents <BoxCollider>()) { if (boxCol.isTrigger) { boxCol.enabled = false; } else { boxCol.enabled = true; } } GetComponent <MeshRenderer>().enabled = true; GetComponent <NavMeshObstacle>().enabled = true; if (boss_Type == Boss_Type.LASER) { //spawns laser boss boss_GO = GameObject.Find("Laser_Boss").gameObject; boss_Pos = GameObject.FindGameObjectWithTag("Laser_Pos"); // boss_GO.transform.SetParent(GameObject.FindGameObjectWithTag("Boss_Room").transform); boss_GO.SetActive(false); boss_GO.transform.position = new Vector3(365.5667f, -18.6f, 65.15f); boss_GO.gameObject.SetActive(true); // boss_GO.transform.position = GameObject.FindGameObjectWithTag("Laser_Pos").transform.position; boss_GO.GetComponent <Laser_Boss_Spawn>().Spawn(); } else { //spawns multi disc boss } // boss_GO.SetActive(true); //Putting Door on Environment layer gameObject.layer = 14; cam.SetNewTarget(transform, (Vector3.forward * 15f)); StartCoroutine(shootingScript.Recall()); moveScript.LockHover(true); }