Skip to content

Commit 609f055

Browse files
updated api and sdk compatibility
1 parent 272d5fd commit 609f055

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Assets/HoloToolkit/BuildAndDeploy/Editor/BuildDeployWindow.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ public class BuildDeployWindow : EditorWindow
2525
private const float GUISectionOffset = 10.0f;
2626
private const string GUIHorizontalSpacer = " ";
2727
private const float UpdateBuildsPeriod = 1.0f;
28+
private const string SdkVersion =
29+
#if UNITY_2017_2_OR_NEWER
30+
"10.0.16299.0";
31+
#else
32+
"10.0.15063.0";
33+
#endif
2834

2935
private enum BuildPlatformEnum
3036
{
@@ -310,7 +316,7 @@ private void OnGUI()
310316
}
311317
else
312318
{
313-
if (windowsSdkPaths[i].Equals("10.0.16299.0"))
319+
if (windowsSdkPaths[i].Equals(SdkVersion))
314320
{
315321
currentSDKVersionIndex = i;
316322
}
@@ -319,10 +325,10 @@ private void OnGUI()
319325

320326
if (currentSDKVersionIndex == 0)
321327
{
322-
Debug.LogError("Unable to find the required Windows 10 SDK Target!\nPlease be sure to install the 10.0.16299.0 SDK from Visual Studio Installer.");
328+
Debug.LogErrorFormat("Unable to find the required Windows 10 SDK Target!\nPlease be sure to install the {0} SDK from Visual Studio Installer.", SdkVersion);
323329
}
324330

325-
EditorGUILayout.LabelField(GUIHorizontalSpacer + "Required SDK Version: 10.0.16299.0");
331+
EditorGUILayout.LabelField(GUIHorizontalSpacer + "Required SDK Version: " + SdkVersion);
326332

327333
var curScriptingBackend = PlayerSettings.GetScriptingBackend(BuildTargetGroup.WSA);
328334
var newScriptingBackend = (ScriptingImplementation)EditorGUILayout.IntPopup(

Assets/HoloToolkit/Utilities/Scripts/WindowsApiChecker.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ public static class WindowsApiChecker
1313
static WindowsApiChecker()
1414
{
1515
#if !UNITY_EDITOR && UNITY_WSA
16+
#if UNITY_2017_2_OR_NEWER
1617
UniversalApiContractV5_IsAvailable = Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5);
1718
UniversalApiContractV4_IsAvailable = Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 4);
19+
#endif
1820
UniversalApiContractV3_IsAvailable = Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3);
1921
#else
2022
UniversalApiContractV5_IsAvailable = false;

0 commit comments

Comments
 (0)