123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System.Collections;
- using GHZLangChao;
- using Blue;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.Events;
- public class ChooseManager : MonoBehaviour,IController
- {
- [SerializeField] private GameObject Tip;
- [SerializeField] private GameObject ShowDevice => SceneIOCContainer.Instance.Pull("ShowDevice") as GameObject;
- [SerializeField] private Toggle ShowHide_Toggle;
- private IQueueSystem mQueueSystem;
- void Awake()
- {
- transform.localPosition = new Vector3(0,0,500f);
- StartCoroutine(ControlTip());
- ShowDevice.SetActive(true);
- ShowHide_Toggle.onValueChanged.AddListener(ShowHideLevel3);
- mQueueSystem = this.GetService<IQueueSystem>();
- mQueueSystem.Level3QueueCount.Register(mQueueSystemCountNotNull).UnRegisterWhenGameObjectDestroyed(gameObject);
- SceneIOCContainer.Instance.Push("ShowChoose",gameObject);
- }
- public void GotoXunJian()
- {
- Debug.Log("DGJ =====>GotoXunJian ");
- ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowXunJian);
- }
- public void GotoSupport()
- {
- Debug.Log("DGJ =====>GotoSupport ");
- ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowRTC);
- }
- public void GotoNav()
- {
- Debug.Log("=====>GotoNav ");
- ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowXunJian);
- ShowXunJian.Instance.gotoWindow(ScenesManager.SceneType.ShowDH);
- }
- private IEnumerator ControlTip()
- {
- Tip.SetActive(true);
- yield return new WaitForSeconds(3);
- Tip.SetActive(false);
- }
- private void OnEnable()
- {
- if(mQueueSystem.Level3QueueCount.Value>0)
- ShowHide_Toggle.interactable = true;
- Debug.Log($"打开的数量:{mQueueSystem.Level3QueueCount.Value}");
- }
- private void ShowHideLevel3(bool on)
- {
- Debug.Log("Level3Queue:"+mQueueSystem.Level3List.Count);
- foreach(var go in mQueueSystem.Level3List)
- {
- go.SetActive(!on);
- }
- }
- #region 事件监听
- private void mQueueSystemCountNotNull(int newCount)
- {
- if(newCount>0)
- ShowHide_Toggle.interactable = true;
- Debug.Log($"打开的数量:{mQueueSystem.Level3QueueCount.Value}");
- }
- #endregion
- }
|