31 lines
806 B
C#
31 lines
806 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class SceneController : MonoBehaviour
|
|
{
|
|
private int currentSceneIndex = 0;
|
|
|
|
// this object will always exist!
|
|
void Awake() {
|
|
DontDestroyOnLoad(this.gameObject);
|
|
}
|
|
|
|
// public void NextScene() {
|
|
// currentSceneIndex += 1;
|
|
|
|
// print("attempting to load scene " + currentSceneIndex);
|
|
// if (currentSceneIndex < SceneManager.sceneCount) {
|
|
// SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
|
|
// } else {
|
|
// print("no more scenes!");
|
|
// }
|
|
// }
|
|
|
|
public void NextScene() {
|
|
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
|
|
}
|
|
|
|
}
|