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

feat : add shop scene

parent fae32e06
Branches
Tags
1 merge request!32[Feat] Shop scene finished
This diff is collapsed.
fileFormatVersion: 2
guid: ae4bbbcc38360e84b9b2f40b8837854a
timeCreated: 1519364665
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -2,23 +2,29 @@ using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System.Collections;
using Nightmare;
public class CountdownManager : MonoBehaviour {
public int countdownTime;
private int countdown;
public Text countdownDisplay;
private bool isRunning = false;
private Coroutine countdownCoroutine;
LevelManager lm;
// Start the countdown coroutine if it's set to start automatically
void Start() {
countdown = countdownTime;
lm = FindObjectOfType<LevelManager>();
if (isRunning) {
StartCountdown();
}
}
private IEnumerator CountdownToStart() {
while (countdownTime > 0) {
while (countdownTime > 0)
{
countdownDisplay.text = countdownTime.ToString();
yield return new WaitForSeconds(1);
countdownTime--;
......@@ -26,7 +32,16 @@ public class CountdownManager : MonoBehaviour {
countdownDisplay.text = "0";
StopCountdown();
LoadMenuScene();
if (countdown == 10)
{
LoadMenuScene();
}
else
{
lm.AdvanceLevel();
}
ResetCountdown();
}
......
......@@ -60,10 +60,7 @@ namespace Nightmare
currentScene = scene;
// Play realtime cinematic?
if (currentLevel > 1)
cinema.StartCinematic(CinematicController.CinematicType.Realtime);
else
cinema.StartCinematic(CinematicController.CinematicType.PreRendered);
cinema.StartCinematic(CinematicController.CinematicType.Realtime);
}
private void DisableOldScene()
......
......@@ -42,7 +42,7 @@ public class QuestManager : MonoBehaviour
Time.timeScale = 1;
if (lm.GetCurrLevel() < 3)
{
lm.AdvanceLevel();
SceneManager.LoadSceneAsync("Shop", LoadSceneMode.Additive);
}
else
{
......
......@@ -29,4 +29,7 @@ EditorBuildSettings:
- enabled: 1
path: Assets/Scenes/Cutscene02.unity
guid: e7932cbf39964a84c9c3e5e4c12a57a4
- enabled: 1
path: Assets/Scenes/Shop.unity
guid: ae4bbbcc38360e84b9b2f40b8837854a
m_configObjects: {}
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