add welcome menu

This commit is contained in:
ntr committed 2022-05-26 17:39:12 +10:00
1 parent 8e9f8c598f
commit 1146fb1c7f
28 files changed
+10121 -704

No files matched your search

+5 -1
View File
@@ -61,13 +61,17 @@ public class Loader : MonoBehaviour {
public void NextScene() {
int current = scene.buildIndex;
int next = (current + 1) % (SceneManager.sceneCountInBuildSettings);
// welcome is at 0. skip it
if (next == 0) next = 1;
if (next != current) LoadScene(next);
}
public void PrevScene() {
int current = scene.buildIndex;
int prev = (current - 1);
if (prev < 0) prev = SceneManager.sceneCountInBuildSettings - 1;
// check for welcome
if (prev <= 0) prev = SceneManager.sceneCountInBuildSettings - 1;
if (prev != current) LoadScene(prev);
}