void MenuUpdate() { if (Input.GetKeyDown(KeyCode.Escape)) { menuActive = !menuActive; SetPlayerActive(!menuActive); title.Darken(menuActive); menu.Show(menuActive); } if (menuActive) { menu.Update(Time.deltaTime); if (Input.GetKeyDown(KeyCode.DownArrow)) { menu.Down(); } if (Input.GetKeyDown(KeyCode.UpArrow)) { menu.Up(); } if (Input.GetKeyDown(KeyCode.Return)) { int item = menu.Accept(); if (item == 0) { title.DisableCamera(); menu.Show(false, true); menuActive = false; BuildMap(GetMapName((mapFormat == MapFormat.MAP)?1:11)); } if (item == 4) { #if UNITY_EDITOR EditorApplication.isPlaying = false; #endif Application.Quit(); } } } }
void BuildMap(string mapname) { if (menuActive) { menu.Show(false, true); menuActive = false; } if (GameObject.Find(currentMap) != null) { GameObject.Find(currentMap).name = "CLEAR"; } time = Time.realtimeSinceStartup; currentMap = mapname; if (mapinfo != null) { mapBuilder.SetMapInfo(mapinfo.ContainsKey(mapname) ? mapinfo[mapname] : null); } mapBuilder.doneBuilding = FinishMap; mapBuilder.BuildMap(wad, mapname); buildingMap = true; }
void BuildMap(string mapName) { if (menuActive) { menu.Show(false, true); menuActive = false; } if (mapBuilder != null) { mapBuilder.Destroy(); } currentMap = mapName; mapBuilder = new DoomMapBuilder(wad, new DoomMapData(wad, mapName)); mapBuilder.BuildMap(); mapBuilder.BuildPlayer(playerPrefab); if (wad.multigen != null) { mapBuilder.BuildLevelEntities(Settings.Get("nomonsters", "false") == "false"); } title.DisableCamera(); if (midiEnabled) { PlayMidi(mapinfo[currentMap].music); } HUDObject.SetActive(true); HUD.SetMapName(mapinfo[currentMap].name); stBarObject.SetActive(true); }