using UnityEngine; using UnityEngine.UI; using UniRx; public class SmokeSystemMenuPanel : UIView { public Toggle ForcedDraftFanToggle; public Toggle AirVentToggle; public Toggle SmokeExtractionFanToggle; public Toggle SmokeVentToggle; public override void Awake() { base.Awake(); ForcedDraftFanToggle.onValueChanged.AddListener((bool value) => MainMenu.Instance.OnForcedDraftFan(value)); AirVentToggle.onValueChanged.AddListener((bool value) => MainMenu.Instance.OnAirVent(value)); SmokeExtractionFanToggle.onValueChanged.AddListener((bool value) => MainMenu.Instance.OnSmokeExtractionFan(value)); SmokeVentToggle.onValueChanged.AddListener((bool value) => MainMenu.Instance.OnSmokeVent(value)); } public override void Hide() { base.Hide(); ForcedDraftFanToggle.isOn = false; AirVentToggle.isOn = false; SmokeExtractionFanToggle.isOn = false; SmokeVentToggle.isOn = false; } }