Exemple #1
0
    void StartGame(IwadInfo info)
    {
        mapBuilder = new DoomMapBuilder();

        if (args.runTests)
        {
            Debug.Log("Running tests...");

            // Keep a separate map builder to avoid issues building maps afterwards
            DoomMapBuilder testMapBuilder = new DoomMapBuilder();

            foreach (KeyValuePair <string, MapInfo> entry in mapinfo)
            {
                int errors = testMapBuilder.TestMap(wad, entry.Key);
                if (errors > 0)
                {
                    Debug.Log("Failed sectors in " + entry.Key + ": " + errors);
                }
            }
        }

        if (args.warp == "")
        {
            title.Build(wad);
            PlayMidi(info.titleMusic);
        }
        else
        {
            title.DisableCamera();
            menuActive = false;
            BuildMap(args.warp);
        }
        SetupMenu();
        SetupHUD();
    }
Exemple #2
0
    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);
    }