Browse Source

任务1077

蓝色星空 1 year ago
parent
commit
062d59f560

+ 22 - 0
Assets/Game/Blue/Event/GaiLanInfoActiveEvent.cs

@@ -0,0 +1,22 @@
+using Blue;
+
+/// <summary>
+/// 概览信息面板打开事件
+/// </summary>
+public class GaiLanInfoActiveEvent : IEvent
+{
+    public bool Active;
+}
+
+public class GaiLanInfoActiveCommand : ICommand
+{
+    private bool active;
+    public GaiLanInfoActiveCommand(bool active)
+    {
+        this.active = active;
+    }
+    public void OnExcute()
+    {
+        this.SendEvent<GaiLanInfoActiveEvent>(new GaiLanInfoActiveEvent() { Active = active });
+    }
+}

+ 11 - 0
Assets/Game/Blue/Event/GaiLanInfoActiveEvent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e1f4ed17b620d5e4991b942e16d44a4f
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 1
Assets/Game/ShowChoose/ChooseManager.cs

@@ -1,9 +1,10 @@
 using System.Collections;
 using GHZLangChao;
+using Blue;
 using UnityEngine;
 using UnityEngine.UI;
 
-public class ChooseManager : MonoBehaviour
+public class ChooseManager : MonoBehaviour,IController
 {
     [SerializeField] private GameObject Tip;
     [SerializeField] private GameObject ShowDevice => SceneIOCContainer.Instance.Pull("ShowDevice") as GameObject;
@@ -12,6 +13,9 @@ public class ChooseManager : MonoBehaviour
     {
         StartCoroutine(ControlTip());
         ShowDevice.SetActive(true);
+
+        //this.SendCommand<GaiLanInfoActiveCommand>(new GaiLanInfoActiveCommand(true)); 发送一个命令即可
+        this.RegisterEvent<GaiLanInfoActiveEvent>(GaiLanInfoActive); //当设备概览信息显示出来后,该按钮可进行隐藏或显示;设备概览信息未触发的情况,点击该按钮无响应
     }
 
     public void GotoXunJian()
@@ -32,4 +36,11 @@ public class ChooseManager : MonoBehaviour
         yield return new WaitForSeconds(3);
         Tip.SetActive(false);
     }
+
+    #region 事件监听
+    private void GaiLanInfoActive(GaiLanInfoActiveEvent e)
+    {
+        ShowHide_Toggle.interactable = e.Active;
+    }
+    #endregion
 }