Skip to content

Commit a93f418

Browse files
authored
Update minimum version to 6.0 LTS for 4.x packages (#1112)
* Update docs * Update package manifests * Remove #if UNITY_6000_0_OR_NEWER from code * Update auto-updated Unity files * Update to latest gitignore From https://github.com/github/gitignore/blob/main/Unity.gitignore * Update CHANGELOGs
1 parent 235652c commit a93f418

31 files changed

Lines changed: 633 additions & 331 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
### Long Term Support
3434

35-
* Minimum requirements: OpenXR, Unity 2022.3 LTS, Unity’s XR Interaction Toolkit 3.0.
35+
* Minimum requirements: OpenXR, Unity 6.0 LTS, Unity’s XR Interaction Toolkit 3.0.
3636

3737
## Packages
3838

UnityProjects/.gitignore

Lines changed: 0 additions & 90 deletions
This file was deleted.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# This .gitignore file should be placed at the root of your Unity project directory
2+
#
3+
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
4+
#
5+
.utmp/
6+
/[Ll]ibrary/
7+
/[Tt]emp/
8+
/[Oo]bj/
9+
/[Bb]uild/
10+
/[Bb]uilds/
11+
/[Ll]ogs/
12+
/[Uu]ser[Ss]ettings/
13+
*.log
14+
15+
# By default unity supports Blender asset imports, *.blend1 blender files do not need to be commited to version control.
16+
*.blend1
17+
*.blend1.meta
18+
19+
# MemoryCaptures can get excessive in size.
20+
# They also could contain extremely sensitive data
21+
/[Mm]emoryCaptures/
22+
23+
# Recordings can get excessive in size
24+
/[Rr]ecordings/
25+
26+
# Uncomment this line if you wish to ignore the asset store tools plugin
27+
# /[Aa]ssets/AssetStoreTools*
28+
29+
# Autogenerated Jetbrains Rider plugin
30+
/[Aa]ssets/Plugins/Editor/JetBrains*
31+
# Jetbrains Rider personal-layer settings
32+
*.DotSettings.user
33+
34+
# Visual Studio cache directory
35+
.vs/
36+
37+
# Gradle cache directory
38+
.gradle/
39+
40+
# Autogenerated VS/MD/Consulo solution and project files
41+
ExportedObj/
42+
.consulo/
43+
*.csproj
44+
*.unityproj
45+
*.sln
46+
*.slnx
47+
*.suo
48+
*.tmp
49+
*.user
50+
*.userprefs
51+
*.pidb
52+
*.booproj
53+
*.svd
54+
*.pdb
55+
*.mdb
56+
*.opendb
57+
*.VC.db
58+
59+
# Unity3D generated meta files
60+
*.pidb.meta
61+
*.pdb.meta
62+
*.mdb.meta
63+
64+
# Unity3D generated file on crash reports
65+
sysinfo.txt
66+
67+
# Mono auto generated files
68+
mono_crash.*
69+
70+
# Builds
71+
*.apk
72+
*.aab
73+
*.unitypackage
74+
*.unitypackage.meta
75+
*.app
76+
77+
# Crashlytics generated file
78+
crashlytics-build.properties
79+
80+
# TestRunner generated files
81+
InitTestScene*.unity*
82+
83+
# Addressables default ignores, before user customizations
84+
/ServerData
85+
/[Aa]ssets/StreamingAssets/aa*
86+
/[Aa]ssets/AddressableAssetsData/link.xml*
87+
/[Aa]ssets/Addressables_Temp*
88+
# By default, Addressables content builds will generate addressables_content_state.bin
89+
# files in platform-specific subfolders, for example:
90+
# /Assets/AddressableAssetsData/OSX/addressables_content_state.bin
91+
/[Aa]ssets/AddressableAssetsData/*/*.bin*
92+
93+
# Visual Scripting auto-generated files
94+
/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db
95+
/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db.meta
96+
/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers
97+
/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers.meta
98+
99+
# Auto-generated scenes by play mode tests
100+
/[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity*
101+
102+
# Project Specific List
103+
/[Aa]ssets/[Bb]uild[Rr]eports*
104+
/[Aa]ssets/[Oo]culus*
105+
/[Aa]ssets/[Ss]amples*
106+
/[Aa]ssets/TextMesh Pro*
107+
*.pfx
108+
*.pfx.meta

UnityProjects/MRTKDevTemplate/Assets/BuildAssets/BuildApp.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,10 @@ private static void PatchHands(bool addDebug)
251251
visualizer.JointMaterial = AssetDatabase.LoadAssetAtPath<Material>(AssetDatabase.GUIDToAssetPath(HandJointMaterialGuid));
252252
visualizer.JointMesh = Resources.GetBuiltinResource<Mesh>("Cube.fbx");
253253
}
254-
#if UNITY_6000_0_OR_NEWER
255254
else
256255
{
257256
PrefabUtility.RemoveUnusedOverrides(new[] { leftHandVisualizer }, UnityEditor.InteractionMode.UserAction);
258257
}
259-
#endif
260258
PrefabUtility.SaveAsPrefabAsset(leftHandVisualizer, leftHandPath);
261259
}
262260
PrefabUtility.UnloadPrefabContents(leftHandVisualizer);

UnityProjects/MRTKDevTemplate/Assets/Scripts/Editor/AndroidXRConfig.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
// Copyright (c) Mixed Reality Toolkit Contributors
22
// Licensed under the BSD 3-Clause
33

4-
#if UNITY_6000_0_OR_NEWER
54
using UnityEditor;
65
using UnityEditor.PackageManager;
76
using UnityEditor.PackageManager.Requests;
87
using UnityEngine;
9-
#endif
108

119
namespace MixedReality.Toolkit.Examples.Demos.Editor
1210
{
1311
internal class AndroidXRConfig
1412
{
15-
#if UNITY_6000_0_OR_NEWER
1613
private static AddAndRemoveRequest request;
1714

1815
[MenuItem("Mixed Reality/MRTK3/Examples/Configure for Android XR...", priority = int.MaxValue)]
@@ -38,6 +35,5 @@ private static void Progress()
3835
request = null;
3936
}
4037
}
41-
#endif
4238
}
4339
}

UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeTracking/TargetPositioning/MoveObjectByEyeGaze.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class MoveObjectByEyeGaze : StatefulInteractable
112112
/// Limits the Z position of the GameObject to the specified minimum and maximum.
113113
/// </summary>
114114
public Vector2 LocalMinMaxZ = new Vector2(float.NegativeInfinity, float.PositiveInfinity);
115-
115+
116116
[Tooltip("Fired when the GameObject is dropped.")]
117117
[SerializeField]
118118
private UnityEvent onDrop = null;
@@ -123,7 +123,7 @@ public class MoveObjectByEyeGaze : StatefulInteractable
123123

124124
private bool
125125
onlyEyeWarpOnRelease =
126-
true; // Only warp the currently grabbed target to the current look at location once the user releases the pinch gesture.
126+
true; // Only warp the currently grabbed target to the current look at location once the user releases the pinch gesture.
127127

128128
private float originalTransparency = -1f;
129129
private bool originalUseGravity = false;
@@ -366,13 +366,13 @@ private bool IsLookingAwayFromTarget()
366366
// Check whether the user is still looking within the proximity of the target
367367
float distanceBetweenTargetAndCurrHitPos = Angle_ToCurrHitTarget(gameObject);
368368

369-
// **Note for potential improvement**: It would be better to make this dependent on the target's boundary
369+
// **Note for potential improvement**: It would be better to make this dependent on the target's boundary
370370
// instead of its center. The way it is implemented right now may cause problems for large-scale targets.
371371
return distanceBetweenTargetAndCurrHitPos > minLookAwayDistToEnableEyeWarp;
372372
}
373373

374374
/// <summary>
375-
/// Determine whether the user is looking away from the preview.
375+
/// Determine whether the user is looking away from the preview.
376376
/// </summary>
377377
private bool IsLookingAwayFromPreview()
378378
{
@@ -405,7 +405,7 @@ private bool IsLookingAwayFromPreview()
405405

406406
/// <summary>
407407
/// Check if the destination is plausible. For example, this means if the target is placeable
408-
/// on horizontal surfaces then only show a preview for (more or less) horizontal surfaces.
408+
/// on horizontal surfaces then only show a preview for (more or less) horizontal surfaces.
409409
/// </summary>
410410
/// <returns>True if the target can be placed on this surface.</returns>
411411
private bool IsDestinationPlausible()
@@ -490,13 +490,8 @@ private void DragAndDrop_Start()
490490
originalUseGravity = rigidbody.useGravity;
491491
rigidbody.useGravity = false;
492492

493-
#if UNITY_6000_0_OR_NEWER
494493
originalDrag = rigidbody.linearDamping;
495494
rigidbody.linearDamping = float.PositiveInfinity;
496-
#else
497-
originalDrag = rigidbody.drag;
498-
rigidbody.drag = float.PositiveInfinity;
499-
#endif
500495
}
501496
}
502497
}
@@ -525,11 +520,7 @@ private void DragAndDrop_Finish()
525520
if (TryGetComponent<Rigidbody>(out var rigidbody))
526521
{
527522
rigidbody.useGravity = originalUseGravity;
528-
#if UNITY_6000_0_OR_NEWER
529523
rigidbody.linearDamping = originalDrag;
530-
#else
531-
rigidbody.drag = originalDrag;
532-
#endif
533524
}
534525

535526
onDrop.Invoke();

UnityProjects/MRTKDevTemplate/Assets/Scripts/TetheredPlacement.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace MixedReality.Toolkit.Examples.Demos
1111
{
1212
/// <summary>
13-
/// Helper script to re-spawn objects if they go too far from their original position.
13+
/// Helper script to re-spawn objects if they go too far from their original position.
1414
/// </summary>
1515
/// <remarks>
1616
/// The helper is useful for objects that will fall forever.
@@ -28,7 +28,7 @@ internal class TetheredPlacement : MonoBehaviour
2828

2929
/// <summary>
3030
/// A Unity event function that is called on the frame when a script is enabled just before any of the update methods are called the first time.
31-
/// </summary>
31+
/// </summary>
3232
private void Start()
3333
{
3434
rigidBody = GetComponent<Rigidbody>();
@@ -49,11 +49,7 @@ private void LateUpdate()
4949
// Reset any velocity from falling or moving when re-spawning to original location
5050
if (rigidBody != null)
5151
{
52-
#if UNITY_6000_0_OR_NEWER
5352
rigidBody.linearVelocity = Vector3.zero;
54-
#else
55-
rigidBody.velocity = Vector3.zero;
56-
#endif
5753
rigidBody.angularVelocity = Vector3.zero;
5854
}
5955

@@ -63,4 +59,4 @@ private void LateUpdate()
6359
}
6460
}
6561
}
66-
#pragma warning restore CS1591
62+
#pragma warning restore CS1591

0 commit comments

Comments
 (0)