homeScript.cs 995 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using System.Runtime.InteropServices;
  6. using UnityEngine.SceneManagement;
  7. public class homeScript : MonoBehaviour
  8. {
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. }
  13. // Update is called once per frame
  14. void Update()
  15. {
  16. }
  17. public void SetScene(string type)
  18. {
  19. if (type == "1")
  20. {
  21. SceneManager.LoadScene("light");
  22. }
  23. else if (type == "2")
  24. {
  25. SceneManager.LoadScene("police");
  26. }
  27. else if (type == "3")
  28. {
  29. SceneManager.LoadScene("pay");
  30. }
  31. else if (type == "4")
  32. {
  33. SceneManager.LoadScene("necklace");
  34. }
  35. else if (type == "5")
  36. {
  37. SceneManager.LoadScene("door");
  38. }
  39. else if (type == "6")
  40. {
  41. SceneManager.LoadScene("curtains");
  42. }
  43. }
  44. }