using System; using System.Collections; using System.Collections.Generic; using UnityEngine; [Serializable] public class AssetData:IEquatable { public string serialNumber; // 序列号 public string name; // 名称 public string assetType; // 资产类型 public bool Equals(AssetData other) { if (other is null) return false; if (ReferenceEquals(this, other)) return true; return serialNumber == other.serialNumber && name == other.name && assetType == other.assetType; } public override int GetHashCode() { return HashCode.Combine(serialNumber, name, assetType); } // 重写ToString方法 public override string ToString() { return $"序列号: {serialNumber}, 名称: {name}, 资产类型: {assetType}"; } }