@@ -34,6 +34,19 @@ private enum BuildDeployTab
34
34
DeployOptions
35
35
}
36
36
37
+ #if UNITY_2021_2_OR_NEWER
38
+ /// <summary>
39
+ /// Matches the deprecated WSASubtarget.
40
+ /// </summary>
41
+ private enum UWPSubtarget
42
+ {
43
+ AnyDevice = 0 ,
44
+ PC = 1 ,
45
+ Mobile = 2 ,
46
+ HoloLens = 3
47
+ }
48
+ #endif // UNITY_2021_2_OR_NEWER
49
+
37
50
#endregion Internal Types
38
51
39
52
#region Constants and Readonly Values
@@ -166,7 +179,13 @@ private static bool CanInstall
166
179
get
167
180
{
168
181
bool canInstall = true ;
169
- if ( EditorUserBuildSettings . wsaSubtarget == WSASubtarget . HoloLens )
182
+ if (
183
+ #if UNITY_2021_2_OR_NEWER
184
+ currentSubtarget == UWPSubtarget . HoloLens
185
+ #else
186
+ EditorUserBuildSettings . wsaSubtarget == WSASubtarget . HoloLens
187
+ #endif // UNITY_2021_2_OR_NEWER
188
+ )
170
189
{
171
190
canInstall = DevicePortalConnectionEnabled ;
172
191
}
@@ -271,6 +290,10 @@ private static bool UseRemoteTarget
271
290
private static DeviceInfo lastTestConnectionTarget ;
272
291
private static DateTime ? lastTestConnectionTime = null ;
273
292
293
+ #if UNITY_2021_2_OR_NEWER
294
+ private static UWPSubtarget currentSubtarget = UWPSubtarget . AnyDevice ;
295
+ #endif // UNITY_2021_2_OR_NEWER
296
+
274
297
#endregion Fields
275
298
276
299
#region Methods
@@ -380,7 +403,11 @@ private void RenderStandaloneBuildView()
380
403
381
404
private void RenderUnityBuildView ( )
382
405
{
406
+ #if UNITY_2021_2_OR_NEWER
407
+ currentSubtarget = ( UWPSubtarget ) EditorGUILayout . Popup ( "Target Device" , ( int ) currentSubtarget , TARGET_DEVICE_OPTIONS , GUILayout . Width ( HALF_WIDTH ) ) ;
408
+ #else
383
409
EditorUserBuildSettings . wsaSubtarget = ( WSASubtarget ) EditorGUILayout . Popup ( "Target Device" , ( int ) EditorUserBuildSettings . wsaSubtarget , TARGET_DEVICE_OPTIONS , GUILayout . Width ( HALF_WIDTH ) ) ;
410
+ #endif // UNITY_2021_2_OR_NEWER
384
411
385
412
#if ! UNITY_2019_1_OR_NEWER
386
413
var curScriptingBackend = PlayerSettings . GetScriptingBackend ( BuildTargetGroup . WSA ) ;
0 commit comments