void Start() { allRooms = new List<Room>(); mainRooms = new List<Room>(); mapRect = new Rect(); currentSeparationIteraction = 0; currentNumberOfMainRooms = 0; currentStateTime = 0; currentState = 0; if (useNormalRandom) { normalRandomGeneratorWidth = new NormalRandomGenerator((int)minRoomWidth, (int)maxRoomWidth); normalRandomGeneratorHeight = new NormalRandomGenerator((int)minRoomHeight, (int)maxRoomHeight); normalRandomGeneratorWidth.Mean = widthNormalRandomMean; normalRandomGeneratorHeight.Mean = heightNormalRandomMean; normalRandomGeneratorWidth.StandardDeviation = widthNormalRandomStandardDeviation; normalRandomGeneratorHeight.StandardDeviation = heightNormalRandomStandardDeviation; } if (debugMode) { Time.timeScale = debugTimeScale; } else { StartCoroutine(GenerateDungeon()); } }
private void AddRooms() { for (int i = 0; i < numberOfRooms; ++i) { AddRoom(); } if (currentNumberOfMainRooms < minNumberOfMainRooms) { if (useNormalRandom) { normalRandomGeneratorWidth = new NormalRandomGenerator((int)minMainRoomWidth, (int)maxRoomWidth); normalRandomGeneratorHeight = new NormalRandomGenerator((int)minMainRoomHeight, (int)maxRoomHeight); } while (currentNumberOfMainRooms < minNumberOfMainRooms) { AddRandomMainRoom(); } } }