Skip to content
Snippets Groups Projects
Commit c55cdfaf authored by mikeleo03's avatar mikeleo03
Browse files

feat : manage shop scene

parent 9622f46a
Branches
No related merge requests found
...@@ -7,16 +7,12 @@ using Nightmare; ...@@ -7,16 +7,12 @@ using Nightmare;
public class CountdownManager : MonoBehaviour { public class CountdownManager : MonoBehaviour {
public int countdownTime; public int countdownTime;
private int countdown;
public Text countdownDisplay; public Text countdownDisplay;
private bool isRunning = false; private bool isRunning = false;
private Coroutine countdownCoroutine; private Coroutine countdownCoroutine;
LevelManager lm;
// Start the countdown coroutine if it's set to start automatically // Start the countdown coroutine if it's set to start automatically
void Start() { void Start() {
countdown = countdownTime;
lm = FindObjectOfType<LevelManager>();
if (isRunning) { if (isRunning) {
StartCountdown(); StartCountdown();
} }
...@@ -32,16 +28,7 @@ public class CountdownManager : MonoBehaviour { ...@@ -32,16 +28,7 @@ public class CountdownManager : MonoBehaviour {
countdownDisplay.text = "0"; countdownDisplay.text = "0";
StopCountdown(); StopCountdown();
LoadMenuScene();
if (countdown == 10)
{
LoadMenuScene();
}
else
{
lm.AdvanceLevel();
}
ResetCountdown(); ResetCountdown();
} }
......
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