using UnityEngine; using UnityEngine.UI; using UniRx; public class FireDesignMenuPanel : UIView { public Toggle RefugeFloorToggle; public Toggle FireCompartmentToggle; public Toggle FireDoorToggle; public Toggle FireShutterToggle; public override void Awake() { base.Awake(); //避难层 RefugeFloorToggle.OnValueChangedAsObservable() .Subscribe(value => MainMenu.Instance.OnRefugeFloor(value)).AddTo(gameObject); //防火分区 FireCompartmentToggle.OnValueChangedAsObservable() .Subscribe(value => MainMenu.Instance.OnFireCompartment(value)).AddTo(gameObject); //防火门 FireDoorToggle.OnValueChangedAsObservable() .Subscribe(value => MainMenu.Instance.OnFireDoor(value)).AddTo(gameObject); //防火卷帘 FireShutterToggle.OnValueChangedAsObservable() .Subscribe(value => MainMenu.Instance.OnFireShutters(value)).AddTo(gameObject); } public override void Hide() { base.Hide(); RefugeFloorToggle.isOn = false; FireCompartmentToggle.isOn = false; FireDoorToggle.isOn = false; FireShutterToggle.isOn = false; } }