public void SaveNamingCompleted() { roomFrame.material = roomFrame.defaultMaterial; if (TitleInput.text.Length == 0) { FillEmptyRoom(); RoomSelector.RoomNamingCompleted(); RoomSelector.EnableInteraction(); return; } DarkestSoundManager.PlayOneShot("event:/ui/town/button_click"); RoomSelector.RoomNamingCompleted(); if (!DarkestPhotonLauncher.Instanse.CreateNamedRoom(TitleInput.text)) { FillEmptyRoom(); } }
public void RoomButtonClick() { if (!DarkestPhotonLauncher.Instanse.CheckSelectedSkills()) { return; } if (photonRoom == null) { RoomSelector.SaveNamingStart(this); roomFrame.material = DarkestDungeonManager.HighlightMaterial; TitleInput.interactable = true; TitleInput.enabled = true; TitleInput.textComponent.raycastTarget = true; TitleInput.placeholder.raycastTarget = true; (TitleInput.placeholder as Text).text = ""; TitleInput.Select(); } else { DarkestPhotonLauncher.Instanse.Connect(photonRoom); } }
void Start() { blocked = false; created = false; //spawner has not been used GameObject gameControllerObject = GameObject.FindWithTag ("RoomSelector"); roomSelector = gameControllerObject.GetComponent<RoomSelector>(); exists++; }
private void DrawMap() { // Grab a random room number, from the list of taken rooms, // and assign them to the shop room and boss room. int bossRoomNo = FindRandRoom(takenPositions.Count - 1); int shopRoomNo = FindRandRoom(takenPositions.Count - 1); int dungRoomNo = FindRandRoom(takenPositions.Count - 1); int takenA = bossRoomNo; int takenB = shopRoomNo; int takenC = dungRoomNo; if (bossRoomNo == shopRoomNo) { bossRoomNo = FindRandRoom(takenPositions.Count - 1); } if (shopRoomNo == dungRoomNo) { dungRoomNo = FindRandRoom(takenPositions.Count - 1); } if (bossRoomNo == dungRoomNo) { dungRoomNo = FindRandRoom(takenPositions.Count - 1); } int iteration = 0; // Loop through each of the rooms in the grid, // calculate the room size (in world coordinates), // instantiate the room and assign the exits and room variables. foreach (Room room in rooms) { if (room == null) { continue; } Vector2 drawPos = room.gridPos; // Multipley the current room position (on the grid), // to get the room position in real world coordinates. drawPos.x *= roomSizeX; drawPos.y *= roomSizeY; // Instantiate the template room, and grab the room selector script. RoomSelector roomSelector = Instantiate(roomPref, drawPos, Quaternion.identity).GetComponent <RoomSelector>(); // If the bossRoom is the same as shopRoom, find a new room for the boss. // After assign the variables to the room, and pass them through to RoomSelector. if (room.roomType == 1) { room.roomType = 1; } else if (iteration == bossRoomNo) { room.roomType = 2; } else if (iteration == shopRoomNo) { room.roomType = 3; } else if (iteration == dungRoomNo) { room.roomType = 4; } roomSelector.roomType = room.roomType; roomSelector.up = room.doorTop; roomSelector.down = room.doorBot; roomSelector.right = room.doorRight; roomSelector.left = room.doorLeft; // Move the room to the root folder (to keep hierarchy cleaner), // and add one to the iteration. roomSelector.gameObject.transform.SetParent(mapRoot); iteration++; } // Update the navmesh at the start of FixedUpdate(), // this way the generator waits for everything to be instantiated properly. // Once everything is done, the navmesh is updated and the AI works properly. StartCoroutine("UpdateNavmesh"); }