using System.Collections; using System.Collections.Generic; using Unity.VisualScripting; using UnityEngine; /// /// 本地视频告警UI /// public class LocalVideoAlarm : CabinetUIBase { /// /// 摄像头配置 /// public BaseConf baseConf; public LocalVideoAlarmUI localVideoAlarmUI; public Transform Camera; private void Awake() { baseConf = transform.parent.GetComponent().baseConf; } // Start is called before the first frame update void Start() { localVideoAlarmUI.preform.GetComponent().image_view = LocalVideo.Inst.transform.Find("图片轮播").gameObject; Camera = UnityEngine.Camera.main.transform; gameObject.SetActive(false); } // Update is called once per frame void Update() { transform.eulerAngles = Camera.eulerAngles; } public override void OnMenuChanged(Menu menu) { base.OnMenuChanged(menu); if (menu == Menu.M_全景监控_摄像头 && baseConf.conf1.alarmEntities.Count > 0) { gameObject.SetActive(true); localVideoAlarmUI.LoadShowInfo(baseConf.conf1.alarmEntities.Count); } else { if (!gameObject.activeInHierarchy) return; localVideoAlarmUI.canvas.transform.GetChild(0).gameObject.SetActive(false); gameObject.SetActive(false); } } }