using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class MainMenu : MonoBehaviour { private int selectedLevel; private Dictionary levels = new Dictionary() { {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 7}, {6, 10}, {7, 11}, {8, 12}, {9, 13}, {10, 14}, {11, 15}, {12, 16}, {13, 21} }; public void startGame() { Debug.Log("Main Menu: New Game"); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex+1); } public void endGame() { Debug.Log("Main Menu: Quit Game"); Application.Quit(); } public void setSelectedLeve(int level) { selectedLevel = ++level; } public void loadScene() { Debug.Log("Main Menu: Load Level " + levels[selectedLevel]); SceneManager.LoadScene(levels[selectedLevel]); } }