void setTreasureRoomWithPortals(string previous, string current) { previousRoom_entrance = bossPreRoom.transform.Find(previous + "Entrance").gameObject; previousRoom_exit = bossPreRoom.transform.Find(previous + "Door").gameObject; previousRoom_portal = previousRoom_exit.GetComponent <RoomPortal>(); previousRoom_exit.tag = "ExitDoor"; currentRoom_entrance = bossRoom.transform.Find(current + "Entrance").gameObject; currentRoom_exit = bossRoom.transform.Find(current + "Door").gameObject; currentRoom_portal = currentRoom_exit.GetComponent <RoomPortal>(); currentRoom_exit.tag = "EnterDoor"; currentRoom_portal.exitPoint = previousRoom_entrance; previousRoom_portal.exitPoint = currentRoom_entrance; currentRoom_exit.SetActive(true); currentRoom_entrance.SetActive(true); previousRoom_exit.SetActive(true); previousRoom_entrance.SetActive(true); currentRoom_portal.getProperPosition(); previousRoom_portal.getProperPosition(); }
void setBossRoomWithPortals(string previous, string current) { bossRoom = Instantiate(Resources.Load(path + "Bossroom", typeof(GameObject)) as GameObject, new Vector3(bossPreRoomLocation.x * range, bossPreRoomLocation.y * range, 0), Quaternion.identity); bossRoom.name = "BossRoom"; previousRoom_entrance = bossPreRoom.transform.Find(previous + "Entrance").gameObject; previousRoom_exit = bossPreRoom.transform.Find(previous + "Portal").gameObject; previousRoom_portal = previousRoom_exit.GetComponent <RoomPortal>(); previousRoom_exit.tag = "ExitDoor"; currentRoom_entrance = bossRoom.transform.Find(current + "Entrance").gameObject; currentRoom_exit = bossRoom.transform.Find(current + "Portal").gameObject; currentRoom_portal = currentRoom_exit.GetComponent <RoomPortal>(); currentRoom_exit.tag = "EnterDoor"; currentRoom_portal.exitPoint = previousRoom_entrance; previousRoom_portal.exitPoint = currentRoom_entrance; currentRoom_exit.SetActive(true); currentRoom_entrance.SetActive(true); previousRoom_exit.SetActive(true); previousRoom_entrance.SetActive(true); currentRoom_portal.getProperPosition(); previousRoom_portal.getProperPosition(); }