InfraredGuidanceView.cs 1.3 KB

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