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.

24 lines
877 B

4 years ago
  1. using System;
  2. using UnityEngine.XR.ARSubsystems;
  3. namespace UnityEditor.XR.ARSubsystems
  4. {
  5. /// <summary>
  6. /// Utility for creating a <c>UnityEngine.XR.ARSubsystems.SerializableGuid</c>.
  7. /// A <c>SerializableGuid</c> can be serialized by Unity, while a <c>System.Guid</c>
  8. /// cannot.
  9. /// </summary>
  10. public static class SerializableGuidUtil
  11. {
  12. /// <summary>
  13. /// Creates a <c>SerializableGuid</c> from a <c>System.Guid</c>.
  14. /// </summary>
  15. /// <param name="guid">The <c>Guid</c> to represent as a <c>SerializableGuid</c>.</param>
  16. /// <returns>A serializable version of <paramref name="guid"/>.</returns>
  17. public static SerializableGuid Create(Guid guid)
  18. {
  19. ulong low, high;
  20. guid.Decompose(out low, out high);
  21. return new SerializableGuid(low, high);
  22. }
  23. }
  24. }