2023-06-26 13:30:43 +02:00
|
|
|
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;
|
2023-06-26 13:30:43 +02:00
|
|
|
|
|
|
|
private Dictionary<int, int> levels;
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
{
|
|
|
|
levels = new Dictionary<int, int>()
|
|
|
|
{// das hier geht nicht, die build indexes müssen manuell eingetragen werden
|
|
|
|
{1, SceneManager.GetSceneByPath("2PlatzhalterTutorial").buildIndex},
|
|
|
|
{2, SceneManager.GetSceneByPath("3MeowlinTalk").buildIndex},
|
|
|
|
{3, SceneManager.GetSceneByPath("4DScene").buildIndex},
|
|
|
|
{4, SceneManager.GetSceneByPath("5.0TutorialDimShift").buildIndex},
|
|
|
|
{5, SceneManager.GetSceneByPath("6.0Luna").buildIndex},
|
|
|
|
{6, SceneManager.GetSceneByPath("7Prototype").buildIndex},
|
|
|
|
{7, SceneManager.GetSceneByPath("8Francois").buildIndex},
|
|
|
|
{8, SceneManager.GetSceneByPath("9Catman1").buildIndex},
|
|
|
|
{9, SceneManager.GetSceneByPath("10Conflict").buildIndex},
|
|
|
|
{10, SceneManager.GetSceneByPath("11Catman2").buildIndex},
|
|
|
|
{11, SceneManager.GetSceneByPath("14Level_Vanessa").buildIndex},
|
|
|
|
{12, SceneManager.GetSceneByPath("15.0BossVorher").buildIndex},
|
|
|
|
{13, SceneManager.GetSceneByPath("Credits").buildIndex}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
2023-06-26 13:30:43 +02:00
|
|
|
selectedLevel = ++level;
|
2023-06-26 11:06:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void loadScene()
|
|
|
|
{
|
2023-06-26 13:30:43 +02:00
|
|
|
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
|
|
|
}
|