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.

57 lines
1.6 KiB

4 years ago
  1. using System;
  2. namespace UnityEngine.XR.ARFoundation
  3. {
  4. /// <summary>
  5. /// Container for SystemState event arguments. Used by the <see cref="ARSubsystemManager"/>.
  6. /// </summary>
  7. public struct ARSessionStateChangedEventArgs : IEquatable<ARSessionStateChangedEventArgs>
  8. {
  9. /// <summary>
  10. /// The new session state.
  11. /// </summary>
  12. public ARSessionState state { get; private set; }
  13. /// <summary>
  14. /// Constructor for these event arguments.
  15. /// </summary>
  16. /// <param name="state">The new session state.</param>
  17. public ARSessionStateChangedEventArgs(ARSessionState state)
  18. {
  19. this.state = state;
  20. }
  21. public override int GetHashCode()
  22. {
  23. return ((int)state).GetHashCode();
  24. }
  25. public override bool Equals(object obj)
  26. {
  27. if (!(obj is ARSessionStateChangedEventArgs))
  28. return false;
  29. return Equals((ARSessionStateChangedEventArgs)obj);
  30. }
  31. public override string ToString()
  32. {
  33. return state.ToString();
  34. }
  35. public bool Equals(ARSessionStateChangedEventArgs other)
  36. {
  37. return state == other.state;
  38. }
  39. public static bool operator ==(ARSessionStateChangedEventArgs lhs, ARSessionStateChangedEventArgs rhs)
  40. {
  41. return lhs.Equals(rhs);
  42. }
  43. public static bool operator !=(ARSessionStateChangedEventArgs lhs, ARSessionStateChangedEventArgs rhs)
  44. {
  45. return !lhs.Equals(rhs);
  46. }
  47. }
  48. }