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.

61 lines
1.8 KiB

4 years ago
  1. using System;
  2. namespace UnityEngine.XR.ARSubsystems
  3. {
  4. /// <summary>
  5. /// Update parameters for <see cref="XRSessionSubsystem.Update(XRSessionUpdateParams)"/>.
  6. /// </summary>
  7. public struct XRSessionUpdateParams : IEquatable<XRSessionUpdateParams>
  8. {
  9. /// <summary>
  10. /// The current screen orientation
  11. /// </summary>
  12. public ScreenOrientation screenOrientation { get; set; }
  13. /// <summary>
  14. /// The current screen dimensions.
  15. /// </summary>
  16. public Vector2Int screenDimensions { get; set; }
  17. public override int GetHashCode()
  18. {
  19. unchecked
  20. {
  21. var hash = ((int)screenOrientation).GetHashCode();
  22. hash = hash * 486187739 + screenDimensions.GetHashCode();
  23. return hash;
  24. }
  25. }
  26. public override bool Equals(object obj)
  27. {
  28. if (!(obj is XRSessionUpdateParams))
  29. return false;
  30. return Equals((XRSessionUpdateParams)obj);
  31. }
  32. public override string ToString()
  33. {
  34. return string.Format("Screen Orientation: {0}, Screen Dimensions: {1}",
  35. screenOrientation, screenDimensions);
  36. }
  37. public bool Equals(XRSessionUpdateParams other)
  38. {
  39. return
  40. (screenOrientation == other.screenOrientation) &&
  41. (screenDimensions.Equals(other.screenDimensions));
  42. }
  43. public static bool operator ==(XRSessionUpdateParams lhs, XRSessionUpdateParams rhs)
  44. {
  45. return lhs.Equals(rhs);
  46. }
  47. public static bool operator !=(XRSessionUpdateParams lhs, XRSessionUpdateParams rhs)
  48. {
  49. return !lhs.Equals(rhs);
  50. }
  51. }
  52. }