Files
FebGameJam/Assets/Scripts/BeatDark.cs
T
2022-02-27 00:59:55 -06:00

31 lines
696 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class BeatDark : MonoBehaviour
{
public int currentLevel;
public int i = 2;
// Start is called before the first frame update
void Start()
{
currentLevel = PlayerPrefs.GetInt("CurrentLevel");
}
public void BeatLevel()
{
if (i == currentLevel && i <= 6)
{
PlayerPrefs.SetInt("CurrentLevel", i + 1);
SceneManager.LoadScene("Real World");
Debug.Log(i);
}
else
{
SceneManager.LoadScene("Real World");
}
}
}