52 lines
1.0 KiB
C#
Raw Normal View History

using System;
2023-06-08 23:39:07 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
2023-06-26 11:06:06 +02:00
using UnityEngine.UI;
2023-06-08 23:39:07 +02:00
public class MainMenu : MonoBehaviour
{
2023-06-26 11:06:06 +02:00
private int selectedLevel;
private Dictionary<int, int> levels = new Dictionary<int, int>()
{
{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}
};
2023-06-08 23:39:07 +02:00
public void startGame()
{
Debug.Log("Main Menu: New Game");
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex+1);
2023-06-08 23:39:07 +02:00
}
public void endGame()
{
Debug.Log("Main Menu: Quit Game");
Application.Quit();
}
2023-06-26 11:06:06 +02:00
public void setSelectedLeve(int level)
{
selectedLevel = ++level;
2023-06-26 11:06:06 +02:00
}
public void loadScene()
{
Debug.Log("Main Menu: Load Level " + levels[selectedLevel]);
SceneManager.LoadScene(levels[selectedLevel]);
2023-06-26 11:06:06 +02:00
}
2023-06-08 23:39:07 +02:00
}