No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MultiJsonEntry.cs 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. namespace UnityEditor.ShaderGraph.Serialization
  2. {
  3. struct MultiJsonEntry
  4. {
  5. public string id { get; }
  6. public string type { get; }
  7. public string json { get; }
  8. public MultiJsonEntry(string type, string id, string json)
  9. {
  10. this.id = id;
  11. this.type = type;
  12. this.json = json;
  13. }
  14. public bool Equals(MultiJsonEntry other)
  15. {
  16. return id == other.id && type == other.type && json == other.json;
  17. }
  18. public override bool Equals(object obj)
  19. {
  20. return obj is MultiJsonEntry other && Equals(other);
  21. }
  22. public override int GetHashCode()
  23. {
  24. unchecked
  25. {
  26. var hashCode = (id != null ? id.GetHashCode() : 0);
  27. hashCode = (hashCode * 397) ^ (type != null ? type.GetHashCode() : 0);
  28. hashCode = (hashCode * 397) ^ (json != null ? json.GetHashCode() : 0);
  29. return hashCode;
  30. }
  31. }
  32. public override string ToString()
  33. {
  34. return $"{nameof(id)}: {id}, {nameof(type)}: {type}, {nameof(json)}:\n{json}";
  35. }
  36. }
  37. }