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;
|
|
|
|
|
2023-06-08 23:39:07 +02:00
|
|
|
public void startGame()
|
|
|
|
{
|
|
|
|
Debug.Log("Main Menu: New Game");
|
2023-06-22 21:20:53 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void loadScene()
|
|
|
|
{
|
|
|
|
switch (++selectedLevel)
|
|
|
|
{
|
|
|
|
case 5:
|
|
|
|
selectedLevel = 7;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
selectedLevel = 10;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
selectedLevel = 11;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
selectedLevel = 12;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 9:
|
|
|
|
selectedLevel = 13;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10:
|
|
|
|
selectedLevel = 14;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 11:
|
|
|
|
selectedLevel = 15;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 12:
|
|
|
|
selectedLevel = 16;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
Debug.Log("Main Menu: Load Level " + selectedLevel);
|
|
|
|
SceneManager.LoadScene(selectedLevel);
|
|
|
|
}
|
2023-06-08 23:39:07 +02:00
|
|
|
}
|