private void RunBuild() { try { if (_builder != null) { _builder.Build(); } else if (_dungeonBuilder != null) { var log = new MemoryLog(); var mesh = _dungeonBuilder.Build(log); if (Directory.Exists(_dungeonBuilder.Dungeon)) { Directory.Delete(_dungeonBuilder.Dungeon, true); } Directory.CreateDirectory(_dungeonBuilder.Dungeon); log.WriteToFile(_dungeonBuilder.Dungeon + "\\Build.log"); if (mesh != null) { File.WriteAllBytes(_dungeonBuilder.Dungeon + "\\" + _dungeonBuilder.Dungeon + ".dmesh", mesh); } } } catch (Exception e) { MessageBox.Show(e.ToString(), "Mesh Builder Interface - Exception"); } }
public void BuildDungeon(bool updateCamera) { DungeonBuilder builder = new DungeonBuilder(); builder.BeginDungeon(); builder.SetSize(sizeX, sizeY); builder.SetGenerator(new DungeonGeneratorEmpty()); builder.SetRoomDecorator(roomDecorator); builder.Build(); DungeonMap dungeon = builder.GetDungeon(); SetDungeon(dungeon, updateCamera); }
// Start Build private void RunBuild() { try { if (_builder != null) { _builder.Build(); } else if (_dungeonBuilder != null) { var mesh = _dungeonBuilder.Build(); if (mesh != null) { _dungeonBuilder.SaveTile(mesh); } } } catch (Exception e) { MessageBox.Show(e.ToString(), "Mesh Builder Interface - Exception"); } }
public void Close() { PlayerPrefs.SetInt("DungeonTutorial", 1); gameObject.SetActive(false); builder.Build(); }