SceneSwitcher.cs 563 B

123456789101112131415161718192021222324
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. public class SceneSwitcher : MonoBehaviour
  6. {
  7. //public string fromScene;
  8. //public string toScene;
  9. public int sceneId;
  10. // Start is called before the first frame update
  11. void Start()
  12. {
  13. // SceneManager.UnloadSceneAsync(SceneManager.GetActiveScene());
  14. SceneManager.LoadScene(sceneId);
  15. //Application.LoadLevel(sceneId);
  16. }
  17. // Update is called once per frame
  18. void Update()
  19. {
  20. }
  21. }