using UnityEngine; using UnityEngine.UI; using UniRx; using AX.MessageSystem; public class SituationPlottingMenuPanel : UIView { public Toggle DisasterToggle; public Toggle FireForcesToggle; public Toggle LinkageForcesToggle; public Toggle InteriorForcesToggle; public Toggle PlottingToolsToggle; public Toggle SourceToggle; public Toggle CalculatorButton; public Toggle PlanToggle; public Button EditorButton; public Toggle HideNameToggle; public Button ClearButton; public override void Awake() { base.Awake(); //灾情设定 DisasterToggle.OnValueChangedAsObservable() .Subscribe(value => { if (value) { PowerManager.Instance.powerButtonType = PowerButtonType.灾情设定; UIManager.Instance.Show(); } else { UIManager.Instance.Hide(); } }); //消防力量 FireForcesToggle.OnValueChangedAsObservable() .Subscribe(value => { if (value) { PowerManager.Instance.powerButtonType = PowerButtonType.消防力量; UIManager.Instance.Show(); } else { UIManager.Instance.Hide(); } }); //联动力量 LinkageForcesToggle.OnValueChangedAsObservable() .Subscribe(value => { if (value) { PowerManager.Instance.powerButtonType = PowerButtonType.联动力量; UIManager.Instance.Show(); } else { UIManager.Instance.Hide(); } }); //内部力量 InteriorForcesToggle.OnValueChangedAsObservable() .Subscribe(value => { if (value) { PowerManager.Instance.powerButtonType = PowerButtonType.内部力量; UIManager.Instance.Show(); } else { UIManager.Instance.Hide(); } }); //标绘工具 PlottingToolsToggle.OnValueChangedAsObservable() .Subscribe(value => { if (value) { PowerManager.Instance.powerButtonType = PowerButtonType.标绘工具; UIManager.Instance.Show(); } else { UIManager.Instance.Hide(); } }); SourceToggle.OnValueChangedAsObservable() .Subscribe(value => { MessageDispatcher.SendMessage("ICON", value, "OutdoorHydrant"); MessageDispatcher.SendMessage("ICON", value, "SiameseConnection"); }); CalculatorButton.OnValueChangedAsObservable() .Subscribe(value => { if (value) UIManager.Instance.Show(); else UIManager.Instance.Hide(); } ); //处置方案 PlanToggle.OnValueChangedAsObservable() .Subscribe(value => { if (value) UIManager.Instance.Show(); else UIManager.Instance.Hide(); }); //隐藏名称 HideNameToggle.OnValueChangedAsObservable() .Subscribe(value => { PowerManager.Instance.isHideName = value; if (SelectionManager.Instance.Sets.Count > 0) { MessageDispatcher.SendMessage("HIDENAME", value); } }); //批量编辑 EditorButton.GetComponent