using System; using System.Collections; using System.Collections.Generic; using UnityEngine; [Serializable] // 警报数据 public class AlarmData { [SerializeField] private string tagName; // 报警信息 [SerializeField] private string value; // 报警值 [SerializeField] private string createTime; // 报警时间 public string TagName { get => tagName; set => tagName = value; } public string Value { get => value; set => this.value = value; } public string CreateTime { get => createTime; set => createTime = value; } // 重写 ToString 方法以及equals方法 public override string ToString() { return $"TagName: {TagName}, Value: {Value}, CreateTime: {CreateTime}"; } public bool Equals(AlarmData other) { if (other == null) { return false; } return TagName == other.TagName && Value == other.Value && CreateTime == other.CreateTime; } }