using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class SceneLoader : MonoBehaviour { [SerializeField] int startScene = 0; public void LoadNextScene() { int currentSceneIndex = SceneManager.GetActiveScene().buildIndex; SceneManager.LoadScene(currentSceneIndex + 1); } public void ReturnStartScene() { SceneManager.LoadScene(startScene); } public void QuitGame() { Application.Quit(); } public void LoadGameOver() { SceneManager.LoadScene(2); } }
Friday, September 20, 2019
Scene Loader in Unity
For loading scenes:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment