public void GenerateDungeon() { if (currentGraph != null) { DeleteGraph(); } float starttime = Time.realtimeSinceStartup; int i = 0; do { currentGraph = GraphGenerationTool.GenerateGraph(currentSetting); //Camera.main.transform.position = new Vector3(gridWidth / 2, gridHeight / 2, -10); i++; } while (currentGraph == null && i < iterationMax); float generationTime = Time.realtimeSinceStartup - starttime; if (currentGraph == null) { Debug.LogError("Damn we are in trouble ..."); } else { currentGraph = DungeonGenerationTool.GenerateDungeon(difficultySetting, roomSize, currentGraph, roomsPrefabs.rooms.ToArray(), transform); } Debug.Log( "Graph Generation: " + System.Math.Round(generationTime * 1000, 2) + "ms" + "(try:" + i + ")\n" + "Dungeon Instantiation: " + System.Math.Round(((Time.realtimeSinceStartup - starttime) - generationTime) * 1000, 2) + "ms\n" + "Dungeon Generation: " + System.Math.Round((Time.realtimeSinceStartup - starttime) * 1000, 2) + "ms\n"); }
public void GenerateDungeon() { int i = 0; do { currentGraph = GraphGenerationTool.GenerateGraph(currentSetting); i++; } while (currentGraph == null && i < iterationMax); if (currentGraph == null) { Debug.LogError("Damn we are in trouble ..."); } else { currentGraph = DungeonGenerationTool.GenerateDungeon(difficultySetting, roomSize, currentGraph, roomsPrefabs.rooms.ToArray(), transform); } }