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
849 B

4 years ago
  1. using System;
  2. namespace UnityEditor.XR.ARSubsystems
  3. {
  4. /// <summary>
  5. /// Extensions to <c>System.Guid</c>
  6. /// </summary>
  7. public static class GuidExtensions
  8. {
  9. /// <summary>
  10. /// Decomposes a 16-byte <c>Guid</c> into two 8-byte <c>ulong</c>s.
  11. /// Recompose using <c>UnityEngine.XR.ARSubsystems.GuidUtil.Compopse</c>.
  12. /// </summary>
  13. /// <param name="guid">The <c>Guid</c> being extended</param>
  14. /// <param name="low">The lower 8 bytes of the guid.</param>
  15. /// <param name="high">The upper 8 bytes of the guid.</param>
  16. public static void Decompose(this Guid guid, out ulong low, out ulong high)
  17. {
  18. var bytes = guid.ToByteArray();
  19. low = BitConverter.ToUInt64(bytes, 0);
  20. high = BitConverter.ToUInt64(bytes, 8);
  21. }
  22. }
  23. }