//From the chosen options for the map in the menu. Load them into this gameObject to reference.
    public void LoadGameParameterData()
    {
        GameObject          setupObj       = GameObject.FindGameObjectWithTag("SetupData"); //unsure about the name of the object
        GameSetupParameters gameParameters = setupObj.GetComponent <GameSetupParameters>();

        chosenTerrain = gameParameters.terrainType;
        mapDimensions = new Vector2(gameParameters.mapSizeX, gameParameters.mapSizeY);
    }
    //load scene here and store all game setup information
    public void StartGame()
    {
        GameObject          setupData  = GameObject.FindGameObjectWithTag("SetupData");
        GameSetupParameters parameters = setupData.GetComponent <GameSetupParameters> ();

        GatherTeamPlayerData();

        parameters.numberOfTeams     = numberOfTeams;
        parameters.numberOfPlayers   = totalNumberOfPlayers;
        parameters.playerInformation = allPlayers;
        parameters.listOfTeams       = allTeamNames;

        SceneManager.LoadScene(2);
    }
Beispiel #3
0
    //int level is the index of the level in the build settings
    public void LoadScene()
    {
        //SceneManager.LoadScene (terrainChoice);
        GameObject          setupData  = GameObject.FindGameObjectWithTag("SetupData");
        GameSetupParameters parameters = setupData.GetComponent <GameSetupParameters> ();

        parameters.terrainType      = terrainChoice;
        parameters.mapSizeX         = mapSizeX;
        parameters.mapSizeY         = mapSizeY;
        parameters.elementFrequency = elementFrequency;
        parameters.boulders         = boulders;

        SceneManager.LoadScene(1);
    }
    // Use this for initialization
    public void Start()
    {
        onScreenBoulderCount    = 0;
        onScreenElementBoxCount = 0;

        GameObject          setupData  = GameObject.FindGameObjectWithTag("SetupData");
        GameSetupParameters parameters = setupData.GetComponent <GameSetupParameters> ();

        PlayableMapSize.x = parameters.mapSizeX;    //default set to 20
        PlayableMapSize.y = parameters.mapSizeY;    //default set to 20
        elementFrequency  = parameters.elementFrequency;
        chosenTerrain     = parameters.terrainType; //defalt set to lunar

        bouldersOn = parameters.boulders;           //default set to true

        if (bouldersOn)
        {
            _gameMap = CreateMap();

            CreateOnGroundObjects();

            DrawMap();
        }
        else           //do terrain cover process
        {
            terrainCoverMap = new bool[(int)PlayableMapSize.x, (int)PlayableMapSize.y];
            RandomizeTerrain();

            //load the terrain manager
            GameObject temp        = Resources.Load <GameObject> ("Prefabs/TerrainManager");
            var        terrainTemp = Instantiate(temp) as GameObject;
            terrainMode = terrainTemp.GetComponent <TerrainManager> ();

            terrainMode.mapDimensions  = PlayableMapSize;
            terrainMode.chosenTerrain  = chosenTerrain;
            terrainMode.terrainBoolMap = terrainCoverMap;
            terrainMode.tileScale      = tileScale;
            terrainMode.origin         = origin;
            terrainMode.tileBuffer     = screenBuffer;
        }
    }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        gameWon            = false;
        basesPresent       = false;
        playersDistributed = false;
        boulderCount       = 0;
        elementBoxCount    = 0;

        UIOverlayCanvas = GameObject.Find("UIOverlayCanvas");          //load the UI canvas

        GameObject setupData = GameObject.FindGameObjectWithTag("SetupData");

        parameters = setupData.GetComponent <GameSetupParameters> ();

        LoadControlPanel();

        GatherPlayers();

        //Load menu screen parameters in to mapcontroller?
        //Load player selection from menu screen in to "players" list
    }
 public void SetGameSetupParameters(GameSetupParameters gameSetupParameters)
 {
     this.gameSetupParameters = gameSetupParameters;
     Debug.Log("SetGameSetupParameters | isNewGame: " + gameSetupParameters.isNewGame);
 }