DCS/ruiyiweiUX/Assets/Scripts/Views/TopBarView.cs

51 lines
1.2 KiB
C#

// using TMPro;
// using UnityEngine;
// public class TopBarView : MonoBehaviour
// {
// public TextMeshProUGUI PatientInfoText;
// public TextMeshProUGUI AlarmInfoText;
// public TextMeshProUGUI BatteryText;
// public TextMeshProUGUI DateTimeText;
// void OnEnable()
// {
// var alarm = ServiceLocator.Get<IAlarmService>();
// if (alarm != null)
// {
// alarm.OnAlarmRaised += HandleAlarm;
// }
// }
// void OnDisable()
// {
// var alarm = ServiceLocator.Get<IAlarmService>();
// if (alarm != null)
// {
// alarm.OnAlarmRaised -= HandleAlarm;
// }
// }
// void Update()
// {
// var power = ServiceLocator.Get<IPowerService>();
// if (BatteryText != null && power != null)
// {
// BatteryText.text = $"电量 {power.BatteryPercent}%";
// }
// if (DateTimeText != null)
// {
// DateTimeText.text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
// }
// }
// private void HandleAlarm(AlarmEvent evt)
// {
// if (AlarmInfoText == null) return;
// var color = evt.Priority == AlarmPriority.High ? "#FF0000" : (evt.Priority == AlarmPriority.Medium ? "#FFD400" : "#FFFFAA");
// AlarmInfoText.text = $"<color={color}>{evt.Reason}</color>";
// }
// }