Пример #1
0
    // Starts the game - runs all required functions (Start Game button)
    public void StartGame()
    {
        if (numberOfPlayers <= 5 & numberOfPlayers >= 3)
        {
            // set up playerTurn list
            playerTurn.ChangePlayerCount(numberOfPlayers);
            // randomly distribute all territories to players by placing 1 soldier on it
            PlayerLandBank(numberOfPlayers);
            SetBoard();
            // build game stats
            gameStats.SetUpGameStats(numberOfPlayers);
            // give players starting armies
            allocateSoldiers.BuildSoldierBank(numberOfPlayers);
            // set up opening deployment
            openingDeployment.BuildDeployementTable(numberOfPlayers);
            // instruction text
            gameInstructions.OpeningPhasePlacement();
            // remove input box from game
            Destroy(inputBox);
            // fades out audio over 4s
            StartCoroutine(audioFadeOut.FadeOut(openingSound, 2f));
            backgroundAudio.Play();
            // removes all accidental country selections before game starts
            ClearSelections();
            // locks start button after single use
            //TODO: this doesnt work
            startButton.gameObject.SetActive(false);
            inputData.gameObject.SetActive(false);

            targetContinent.FindContinentControl(numberOfPlayers);
        }
    }