mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-11-11 04:22:40 +00:00
Created Level Select Variable
This commit is contained in:
1 parent
b2efcd33b7
commit
9586240adb
12 files changed
+1356
-49
No files matched your search
@@ -0,0 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
|
||||
public class BeatCrowds : MonoBehaviour
|
||||
{
|
||||
public int currentLevel;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
currentLevel = PlayerPrefs.GetInt("CurrentLevel");
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetButtonDown("Jump"))
|
||||
{
|
||||
BeatLevel();
|
||||
}
|
||||
}
|
||||
|
||||
void BeatLevel()
|
||||
{
|
||||
|
||||
if (currentLevel == 1)
|
||||
{
|
||||
PlayerPrefs.SetInt("CurrentLevel", 2);
|
||||
SceneManager.LoadScene("Real World");
|
||||
}else
|
||||
{
|
||||
SceneManager.LoadScene("Real World");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user