InfraredGuidanceView.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class InfraredGuidanceView : JCUnityLib.ViewBase
  6. {
  7. [SerializeField]
  8. GameObject layout1;
  9. [SerializeField]
  10. GameObject layout2;
  11. // Start is called before the first frame update
  12. void Start()
  13. {
  14. #if UNITY_STANDALONE_WIN || UNITY_EDITOR
  15. RectTransform rect = layout1.transform as RectTransform;
  16. rect.localPosition = new Vector3(0, -100, 0);
  17. layout1.GetComponent<VerticalLayoutGroup>().spacing = 30;
  18. RectTransform rect2 = layout2.transform as RectTransform;
  19. rect2.localPosition = new Vector3(0, -115, 0);
  20. layout2.GetComponent<VerticalLayoutGroup>().spacing = 30;
  21. #endif
  22. }
  23. public void OnClick_EnterLayout2() {
  24. //进入标定的页面
  25. AudioMgr.ins.PlayBtn();
  26. layout1.SetActive(false);
  27. layout2.SetActive(true);
  28. }
  29. public void OnClick_EnterScreenPositioningView()
  30. {
  31. //进入标定的页面
  32. AudioMgr.ins.PlayBtn();
  33. ViewManager2.HideView(ViewManager2.Path_InfraredView);
  34. ViewManager2.ShowView(ViewManager2.Path_InfraredScreenPositioningView);
  35. }
  36. public void OnClick_Back()
  37. {
  38. AudioMgr.ins.PlayBtn();
  39. if (!layout1.activeSelf)
  40. {
  41. layout1.SetActive(true);
  42. layout2.SetActive(false);
  43. }
  44. else {
  45. ViewManager2.HideView(ViewManager2.Path_InfraredView);
  46. }
  47. }
  48. }