using System.Collections; using System.Collections.Generic; using UniRx; using UnityEngine; using UnityEngine.UI; public class MainButtonsPanel : UIView { public Button IntroductionButton; public Button FireControlRoomButton; public Button FireDesignButton; public Button SmokeControlButton; public Button WaterSystemButton; public Button EvacuationSystemButton; public Button RoamingButton; public Button WaterSourceButton; public Button RouteMapButton; public Button SituationPlottingButton; public Button LocationButton; public override void Awake() { base.Awake(); //单位简介 IntroductionButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnIntroduction()); //人员定位 LocationButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnPersonnelLocation()); //消控室 FireControlRoomButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnFireControlRoom()); //防火设计 FireDesignButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnFireDesign()); //防排烟系统 SmokeControlButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnSmokeControl()); //供水系统 WaterSystemButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnWaterSystem()); //疏散系统 EvacuationSystemButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnEvacuationSystem()); //体验漫游 RoamingButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnRoaming()); //周边水源 WaterSourceButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnWaterSource()); //行车路线 RouteMapButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnRouteMap()); //态势标绘 SituationPlottingButton.OnClickAsObservable() .Subscribe(_ => MainMenu.Instance.OnSituationPlotting()); } public override void Show() { base.Show(); IntroductionButton.GetComponent().localScale = new Vector3(1, 1, 1); FireControlRoomButton.GetComponent().localScale = new Vector3(1, 1, 1); FireDesignButton.GetComponent().localScale = new Vector3(1, 1, 1); SmokeControlButton.GetComponent().localScale = new Vector3(1, 1, 1); WaterSystemButton.GetComponent().localScale = new Vector3(1, 1, 1); EvacuationSystemButton.GetComponent().localScale = new Vector3(1, 1, 1); RoamingButton.GetComponent().localScale = new Vector3(1, 1, 1); WaterSourceButton.GetComponent().localScale = new Vector3(1, 1, 1); RouteMapButton.GetComponent().localScale = new Vector3(1, 1, 1); SituationPlottingButton.GetComponent().localScale = new Vector3(1, 1, 1); } }