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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								Assets/Scripts/SceneController.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Scripts/SceneController.cs.meta
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
fileFormatVersion: 2
 | 
			
		||||
guid: 5e67b11a22e4341028302b6c176640cb
 | 
			
		||||
MonoImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  serializedVersion: 2
 | 
			
		||||
  defaultReferences: []
 | 
			
		||||
  executionOrder: 0
 | 
			
		||||
  icon: {instanceID: 0}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
		Reference in New Issue
	
	Block a user