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.

50 lines
1.6 KiB

4 years ago
  1. #if UNITY_IOS
  2. using System;
  3. using UnityEditor.Build;
  4. using UnityEditor.Build.Reporting;
  5. using UnityEditor.iOS;
  6. using UnityEngine.XR.ARKit;
  7. namespace UnityEditor.XR.ARKit
  8. {
  9. internal static class LibUtil
  10. {
  11. public static void SelectPlugin(
  12. PluginImporter libXcode10,
  13. PluginImporter libXcode11)
  14. {
  15. const BuildTarget platform = BuildTarget.iOS;
  16. #if UNITY_EDITOR_OSX
  17. var version = GetXcodeVersion();
  18. if (version == new OSVersion(0))
  19. throw new BuildFailedException($"Could not determine which version of Xcode was selected in the Build Settings. Xcode app was computed as \"{GetXcodeApplicationName()}\".");
  20. if (version >= new OSVersion(11))
  21. {
  22. libXcode10?.SetCompatibleWithPlatform(platform, false);
  23. libXcode11?.SetCompatibleWithPlatform(platform, true);
  24. }
  25. else
  26. {
  27. libXcode10?.SetCompatibleWithPlatform(platform, true);
  28. libXcode11?.SetCompatibleWithPlatform(platform, false);
  29. }
  30. #else
  31. libXcode10?.SetCompatibleWithPlatform(platform, false);
  32. libXcode11?.SetCompatibleWithPlatform(platform, true);
  33. #endif
  34. }
  35. static OSVersion GetXcodeVersion()
  36. {
  37. return OSVersion.Parse(GetXcodeApplicationName());
  38. }
  39. static string GetXcodeApplicationName()
  40. {
  41. var index = Math.Max(0, XcodeApplications.GetPreferedXcodeIndex());
  42. return XcodeApplications.GetXcodeApplicationPublicName(index);
  43. }
  44. }
  45. }
  46. #endif