Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Scenes : MonoBehaviour
  6. {
  7. public GameObject scene1, scene2, scene3, scene4;
  8.  
  9. void OnMouseDown()
  10. {
  11.  
  12. if (gameObject.name == "SelectScene1")
  13. {
  14. scene1.SetActive(true);
  15. scene2.SetActive(false);
  16. scene3.SetActive(false);
  17. scene4.SetActive(false);
  18. }
  19.  
  20. if (gameObject.name == "SelectScene2")
  21. {
  22. scene2.SetActive(true);
  23. scene1.SetActive(false);
  24. scene3.SetActive(false);
  25. scene4.SetActive(false);
  26. }
  27.  
  28. if (gameObject.name == "SelectScene3")
  29. {
  30. scene3.SetActive(true);
  31. scene1.SetActive(false);
  32. scene2.SetActive(false);
  33. scene4.SetActive(false);
  34. }
  35. if (gameObject.name == "SelectScene4")
  36. {
  37. scene4.SetActive(true);
  38. scene1.SetActive(false);
  39. scene2.SetActive(false);
  40. scene3.SetActive(false);
  41. }
  42.  
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement