using UnityEngine; using UnityEngine.UI; using UniRx; public class EvacuationSystemMenuPanel : UIView { public Toggle FireEscapeToggle; public Toggle EscapeStairToggle; public Toggle FireElevatorToggle; public override void Awake() { base.Awake(); //安全出口 FireEscapeToggle.OnValueChangedAsObservable() .Subscribe(value => MainMenu.Instance.OnFireEscape(value)); //疏散楼梯 EscapeStairToggle.OnValueChangedAsObservable() .Subscribe(value => MainMenu.Instance.OnEscapeStiar(value)); //消防电梯 FireElevatorToggle.OnValueChangedAsObservable() .Subscribe(value => MainMenu.Instance.OnFireElevator(value)); } public override void Hide() { base.Hide(); FireEscapeToggle.isOn = false; EscapeStairToggle.isOn = false; FireElevatorToggle.isOn = false; } }