Skip to content

Commit b51ad49

Browse files
authored
Merge pull request #1063 from sMartz1/fix/visionos-buildtarget-guard
fix(build): guard BuildTarget.VisionOS with UNITY_2023_2_OR_NEWER
2 parents 8123820 + dcd4963 commit b51ad49

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

MCPForUnity/Editor/Tools/Build/BuildTargetMapping.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public static bool TryResolveBuildTarget(string name, out BuildTarget target)
2424
case "webgl": target = BuildTarget.WebGL; return true;
2525
case "uwp": target = BuildTarget.WSAPlayer; return true;
2626
case "tvos": target = BuildTarget.tvOS; return true;
27-
// VisionOS requires a late 2022.3 patch or Unity 6+; guard broadly
28-
#if UNITY_2022_3_OR_NEWER
27+
// BuildTarget.VisionOS exists only in Unity 2023.2+ and late 2022.3 patches
28+
#if UNITY_2023_2_OR_NEWER
2929
case "visionos": target = BuildTarget.VisionOS; return true;
3030
#endif
3131
default:
@@ -50,7 +50,7 @@ public static BuildTargetGroup GetTargetGroup(BuildTarget target)
5050
case BuildTarget.WebGL: return BuildTargetGroup.WebGL;
5151
case BuildTarget.WSAPlayer: return BuildTargetGroup.WSA;
5252
case BuildTarget.tvOS: return BuildTargetGroup.tvOS;
53-
#if UNITY_2022_3_OR_NEWER
53+
#if UNITY_2023_2_OR_NEWER
5454
case BuildTarget.VisionOS: return BuildTargetGroup.VisionOS;
5555
#endif
5656
default: return BuildTargetGroup.Unknown;

0 commit comments

Comments
 (0)