Commit 8d245092 authored by Marcel Kuehn's avatar Marcel Kuehn
Browse files

ChallengerModus aktivierungskasten im Hauptmenu

parent bba50dbe
This diff is collapsed.
......@@ -77,9 +77,8 @@ public class GameManager : SingletonBehaviour<GameManager> {
HighestLevel++;
}
int tmp = HighestLevel;
bool tmpCh = IsChallengerModeEnabled;
LoadSave.Save(currentLevel, tmp, tmpCh);
SaveData();
LoadLevel(currentLevel);
}
......@@ -133,8 +132,17 @@ public class GameManager : SingletonBehaviour<GameManager> {
public void ResetProgress() {
currentLevel = 1;
HighestLevel = 1;
SaveData();
}
public void SaveData()
{
int highestLevel = HighestLevel;
bool challengerEnabled = IsChallengerModeEnabled;
LoadSave.Save(currentLevel, highestLevel, challengerEnabled);
}
}
using UnityEngine;
using UnityEngine.UI;
public class MainMenuController : MonoBehaviour {
public class MainMenuController : MonoBehaviour
{
[SerializeField] private Toggle modeBool;
private void Awake() {
GameManager.Instance.IsInLevel = false;
}
private void Start()
{
modeBool.isOn=GameManager.Instance.IsChallengerModeEnabled;
}
public void Play() {
GameManager.Instance.ContinueGame();
}
......@@ -29,6 +45,13 @@ public class MainMenuController : MonoBehaviour {
public void SetChallengerOff()
{
GameManager.Instance.IsChallengerModeEnabled = false;
}
public void ToggleChallenger()
{
GameManager.Instance.IsChallengerModeEnabled = modeBool.isOn;
GameManager.Instance.SaveData();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment