added a start screen and scene manager
This commit is contained in:
30
Assets/Scripts/SceneController.cs
Normal file
30
Assets/Scripts/SceneController.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user