Exemple #1
0
    public void LoadLevel()
    {
        string chosenLevel = levelChooser.options[levelChooser.value].text;
        string level       = System.IO.File.ReadAllText(chosenLevel);

        map.LoadMap(level);
        pathfinding.InitiateNew();

        levelsOverlay.SetActive(false);

        CalculatePossibleEnemyMoves();

        Unit firstEncounteredUnit = GetFirstEncounteredUnit();

        Camera.main.transform.position = new Vector3(firstEncounteredUnit.transform.position.x, firstEncounteredUnit.transform.position.y, Camera.main.transform.position.z);
    }