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
50 lines
1.6 KiB
#if UNITY_IOS
|
|
using System;
|
|
using UnityEditor.Build;
|
|
using UnityEditor.Build.Reporting;
|
|
using UnityEditor.iOS;
|
|
using UnityEngine.XR.ARKit;
|
|
|
|
namespace UnityEditor.XR.ARKit
|
|
{
|
|
internal static class LibUtil
|
|
{
|
|
public static void SelectPlugin(
|
|
PluginImporter libXcode10,
|
|
PluginImporter libXcode11)
|
|
{
|
|
const BuildTarget platform = BuildTarget.iOS;
|
|
#if UNITY_EDITOR_OSX
|
|
var version = GetXcodeVersion();
|
|
if (version == new OSVersion(0))
|
|
throw new BuildFailedException($"Could not determine which version of Xcode was selected in the Build Settings. Xcode app was computed as \"{GetXcodeApplicationName()}\".");
|
|
|
|
if (version >= new OSVersion(11))
|
|
{
|
|
libXcode10?.SetCompatibleWithPlatform(platform, false);
|
|
libXcode11?.SetCompatibleWithPlatform(platform, true);
|
|
}
|
|
else
|
|
{
|
|
libXcode10?.SetCompatibleWithPlatform(platform, true);
|
|
libXcode11?.SetCompatibleWithPlatform(platform, false);
|
|
}
|
|
#else
|
|
libXcode10?.SetCompatibleWithPlatform(platform, false);
|
|
libXcode11?.SetCompatibleWithPlatform(platform, true);
|
|
#endif
|
|
}
|
|
|
|
static OSVersion GetXcodeVersion()
|
|
{
|
|
return OSVersion.Parse(GetXcodeApplicationName());
|
|
}
|
|
|
|
static string GetXcodeApplicationName()
|
|
{
|
|
var index = Math.Max(0, XcodeApplications.GetPreferedXcodeIndex());
|
|
return XcodeApplications.GetXcodeApplicationPublicName(index);
|
|
}
|
|
}
|
|
}
|
|
#endif
|