SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
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.

89 lines
2.9 KiB

4 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. namespace UnityEngine.XR.ARFoundation
  4. {
  5. /// <summary>
  6. /// Event arguments for the <see cref="ARPlaneManager.FacesChanged"/> event.
  7. /// </summary>
  8. public struct ARFacesChangedEventArgs : IEquatable<ARFacesChangedEventArgs>
  9. {
  10. /// <summary>
  11. /// The list of <see cref="ARFace"/>s added since the last event.
  12. /// </summary>
  13. public List<ARFace> added { get; private set; }
  14. /// <summary>
  15. /// The list of <see cref="ARFace"/>s udpated since the last event.
  16. /// </summary>
  17. public List<ARFace> updated { get; private set; }
  18. /// <summary>
  19. /// The list of <see cref="ARFace"/>s removed since the last event.
  20. /// </summary>
  21. public List<ARFace> removed { get; private set; }
  22. /// <summary>
  23. /// Constructs an <see cref="ARPlaneChangedEventArgs"/>.
  24. /// </summary>
  25. /// <param name="added">The list of <see cref="ARFace"/>s added since the last event.</param>
  26. /// <param name="updated">The list of <see cref="ARFace"/>s updated since the last event.</param>
  27. /// <param name="removed">The list of <see cref="ARFace"/>s removed since the last event.</param>
  28. public ARFacesChangedEventArgs(
  29. List<ARFace> added,
  30. List<ARFace> updated,
  31. List<ARFace> removed)
  32. {
  33. this.added = added;
  34. this.updated = updated;
  35. this.removed = removed;
  36. }
  37. public override int GetHashCode()
  38. {
  39. unchecked
  40. {
  41. int hash = 0;
  42. hash = hash * 486187739 + (added == null ? 0 : added.GetHashCode());
  43. hash = hash * 486187739 + (updated == null ? 0 : updated.GetHashCode());
  44. hash = hash * 486187739 + (removed == null ? 0 : removed.GetHashCode());
  45. return hash;
  46. }
  47. }
  48. public override bool Equals(object obj)
  49. {
  50. if (!(obj is ARFacesChangedEventArgs))
  51. return false;
  52. return Equals((ARFacesChangedEventArgs)obj);
  53. }
  54. public override string ToString()
  55. {
  56. return string.Format("Added: {0}, Updated: {1}, Removed: {2}",
  57. added == null ? 0 : added.Count,
  58. updated == null ? 0 : updated.Count,
  59. removed == null ? 0 : removed.Count);
  60. }
  61. public bool Equals(ARFacesChangedEventArgs other)
  62. {
  63. return
  64. (added == other.added) &&
  65. (updated == other.updated) &&
  66. (removed == other.removed);
  67. }
  68. public static bool operator ==(ARFacesChangedEventArgs lhs, ARFacesChangedEventArgs rhs)
  69. {
  70. return lhs.Equals(rhs);
  71. }
  72. public static bool operator !=(ARFacesChangedEventArgs lhs, ARFacesChangedEventArgs rhs)
  73. {
  74. return !lhs.Equals(rhs);
  75. }
  76. }
  77. }