SavePoge/Assets/Scripts/MainMenu.cs
2023-02-16 14:58:07 +05:30

34 lines
663 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour
{
public void Play(){
int lastLevel = -1;
foreach(KeyValuePair<int,int> level in LevelSelect.levelProgress){
if(level.Key > lastLevel){
lastLevel=level.Key;
}
}
SceneManager.LoadScene($"Level{lastLevel+1}");
}
public void Levels(){
SceneManager.LoadScene("LevelSelect");
}
void Start()
{
LevelSelect.Init();
}
// Update is called once per frame
void Update()
{
}
}