LayoutManager.cs 825 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class LayoutManager : MonoBehaviour
  5. {
  6. public GameObject layout1;
  7. public GameObject layout2;
  8. public GameObject layoutGun;
  9. void Start()
  10. {
  11. }
  12. // Update is called once per frame
  13. void Update()
  14. {
  15. if (GlobalData.MyDeviceMode == DeviceMode.Gun)
  16. {
  17. if (!layoutGun.activeSelf)
  18. {
  19. layoutGun.SetActive(true);
  20. layout1.SetActive(false);
  21. layout2.SetActive(false);
  22. }
  23. }
  24. else
  25. {
  26. if (layoutGun.activeSelf)
  27. {
  28. layoutGun.SetActive(false);
  29. layout1.SetActive(true);
  30. layout2.SetActive(true);
  31. }
  32. }
  33. }
  34. }