using System; using System.Collections; using System.Collections.Generic; using UnityEngine; [System.Serializable] public class ResearchesData:IEquatable { public string name; // 课题组名称 // 实现IEquatable接口的Equals方法以及重写GetHashCode方法以及ToString方法 public bool Equals(ResearchesData other) { if (other is null) return false; if (ReferenceEquals(this, other)) return true; return name == other.name; } public override int GetHashCode() { return HashCode.Combine(name); } public override string ToString() { return $"课题组名称: {name}"; } }