ChooseManager.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using System.Collections;
  2. using GHZLangChao;
  3. using Blue;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. using UnityEngine.Events;
  7. using static LangChaoJiekou;
  8. public class ChooseManager : MonoBehaviour,IController
  9. {
  10. public bool Test = false;
  11. [SerializeField] private GameObject Tip;
  12. [SerializeField] private GameObject ShowDevice => SceneIOCContainer.Instance.Pull("ShowDevice") as GameObject;
  13. [SerializeField] private Toggle ShowHide_Toggle;
  14. public UnityEvent OnReset = new UnityEvent();
  15. private IQueueSystem mQueueSystem;
  16. void Awake()
  17. {
  18. #if UNITY_EDITOR
  19. Test = true;
  20. #endif
  21. // transform.localPosition = new Vector3(0,0,500f);
  22. Invoke("ControlTip",3);
  23. ShowDevice.SetActive(true);
  24. // ShowHide_Toggle.onValueChanged.AddListener(ShowHideLevel3);
  25. //mQueueSystem = this.GetService<IQueueSystem>();
  26. //mQueueSystem.Level3QueueCount.Register(mQueueSystemCountNotNull).UnRegisterWhenGameObjectDestroyed(gameObject);
  27. //SceneIOCContainer.Instance.Push("ShowChoose",gameObject);
  28. }
  29. public void GotoXunJian()
  30. {
  31. ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowXunJian);
  32. }
  33. public void GetInspectionInfo()
  34. {
  35. // this.GetService<IInspectionService>().Get();
  36. }
  37. public void GotoSupport()
  38. {
  39. Debug.Log("DGJ =====>GotoSupport ");
  40. ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowRTC);
  41. BladeServerManager.Instance.isDaoHang = true;
  42. WayFindingManager.Instance.CloseWayFind();
  43. }
  44. public void GotoNav()
  45. {
  46. Debug.Log("=====>GotoNav ");
  47. ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowXunJian);
  48. ShowXunJian.Instance.gotoWindow(ScenesManager.SceneType.ShowDH);
  49. BladeServerManager.Instance.isDaoHang = true;
  50. }
  51. public void gotozhidao()
  52. {
  53. ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowZhidao);
  54. }
  55. private void ControlTip()
  56. {
  57. Tip.SetActive(false);
  58. }
  59. private void OnEnable()
  60. {
  61. //if(mQueueSystem.Level3QueueCount.Value>0)
  62. // ShowHide_Toggle.interactable = true;
  63. // Debug.Log($"打开的数量:{mQueueSystem.Level3QueueCount.Value}");
  64. //OnReset?.Invoke();
  65. /*
  66. transform.eulerAngles = new Vector3(0, OpenXRCamera.Instance.head.eulerAngles.y, 0);
  67. Vector3 pos = OpenXRCamera.Instance.head.position+ OpenXRCamera.Instance.head.forward * 2.5f;
  68. transform.position = new Vector3(pos.x, 0.5f, pos.z);
  69. */
  70. Debug.Log("DGJ =======> " +transform.position);
  71. BladeServerManager.Instance.isDaoHang = false;
  72. //ShowHideLevel3(true);
  73. }
  74. private void Update()
  75. {
  76. if (Test) return;
  77. #if UNITY_EDITOR
  78. return;
  79. #endif
  80. OnReset?.Invoke();
  81. }
  82. private void ShowHideLevel3(bool on)
  83. {
  84. Debug.Log("Level3Queue:"+mQueueSystem.Level3List.Count);
  85. foreach(var go in mQueueSystem.Level3List)
  86. {
  87. go.SetActive(!on);
  88. }
  89. }
  90. #region 事件监听
  91. private void mQueueSystemCountNotNull(int newCount)
  92. {
  93. if(newCount>0)
  94. ShowHide_Toggle.interactable = true;
  95. Debug.Log($"打开的数量:{mQueueSystem.Level3QueueCount.Value}");
  96. }
  97. #endregion
  98. }