Skip to content

Commit 6c4304c

Browse files
authored
Update version checker to check for 2022.3 (#1056)
Update EditorProjectUtilities.cs
1 parent c1f40a1 commit 6c4304c

File tree

29 files changed

+110
-211
lines changed

29 files changed

+110
-211
lines changed

UnityProjects/MRTKDevTemplate/Assets/Scripts/SampleSceneHandMenu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private void Awake()
5454
previousSceneButton.enabled = IsSceneValid(SceneManager.GetActiveScene().buildIndex - 1);
5555
nextSceneButton.enabled = IsSceneValid(SceneManager.GetActiveScene().buildIndex + 1);
5656

57-
SimpleProfiler profiler = FindObjectUtility.FindFirstObjectByType<SimpleProfiler>(true);
57+
SimpleProfiler profiler = FindFirstObjectByType<SimpleProfiler>(FindObjectsInactive.Include);
5858
if (profiler != null)
5959
{
6060
profilerObject = profiler.gameObject;

org.mixedrealitytoolkit.core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
1717
### Removed
1818

1919
* Removed ITrackedInteractor, as it was supporting an unused codepath and there are better ways to get this data (like querying the attach transform). [PR #1044](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1044)
20+
* Removed FindObjectUtility, as it was a backwards-compatibility layer for pre-2021.3.18. Since our min version is now 2022.3, we can just call the API directly. [PR #1056](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1056)
2021

2122
### Deprecated
2223

org.mixedrealitytoolkit.core/Editor/EditorProjectUtilities.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ static EditorProjectUtilities()
3737
/// </remarks>
3838
public static void CheckMinimumEditorVersion()
3939
{
40-
#if !UNITY_2021_3_OR_NEWER
40+
#if !UNITY_2022_3_OR_NEWER
4141
if (!EditorUtility.DisplayDialog(
4242
"Mixed Reality Toolkit",
43-
"The Mixed Reality Toolkit requires Unity 2021.3 or newer.\n\nUsing an older version of Unity may result in compile-time errors or incorrect behavior.",
43+
"The Mixed Reality Toolkit requires Unity 2022.3 or newer.\n\nUsing an older version of Unity may result in compile-time errors or incorrect behavior.",
4444
"Continue", "Close Editor"))
4545
{
4646
EditorApplication.Exit(0);

org.mixedrealitytoolkit.core/MRTK.Core.asmdef

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
"precompiledReferences": [],
1515
"autoReferenced": true,
1616
"defineConstraints": [],
17-
"versionDefines": [
18-
{
19-
"name": "Unity",
20-
"expression": "2021.3.18",
21-
"define": "UNITY_2021_3_18_OR_NEWER"
22-
}
23-
],
17+
"versionDefines": [],
2418
"noEngineReferences": false
2519
}

org.mixedrealitytoolkit.core/Tests/Runtime/InteractableEventRouterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private XRInteractionManager CachedInteractionManager
4848
{
4949
if (cachedInteractionManager == null)
5050
{
51-
cachedInteractionManager = FindObjectUtility.FindAnyObjectByType<XRInteractionManager>();
51+
cachedInteractionManager = Object.FindAnyObjectByType<XRInteractionManager>();
5252
}
5353
return cachedInteractionManager;
5454
}

org.mixedrealitytoolkit.core/Utilities/ComponentCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static bool TryFindFirstActiveInstance(out T result)
3535
{
3636
if (cacheFirstInstance == null || !cacheFirstInstance.gameObject.activeInHierarchy)
3737
{
38-
cacheFirstInstance = FindObjectUtility.FindFirstObjectByType<T>();
38+
cacheFirstInstance = Object.FindFirstObjectByType<T>();
3939
}
4040

4141
result = cacheFirstInstance;

org.mixedrealitytoolkit.core/Utilities/ControllerLookup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public XRBaseController RightHandController
6363
/// </summary>
6464
private void OnValidate()
6565
{
66-
if (FindObjectUtility.FindObjectsByType<ControllerLookup>(false, false).Length > 1)
66+
if (FindObjectsByType<ControllerLookup>(FindObjectsSortMode.None).Length > 1)
6767
{
6868
Debug.LogWarning("Found more than one instance of the ControllerLookup class in the hierarchy. There should only be one");
6969
}

org.mixedrealitytoolkit.core/Utilities/FindObjectUtility.cs

Lines changed: 0 additions & 82 deletions
This file was deleted.

org.mixedrealitytoolkit.core/Utilities/FindObjectUtility.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

org.mixedrealitytoolkit.core/Utilities/TrackedPoseDriverLookup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public TrackedPoseDriver RightHandTrackedPoseDriver
6060
/// </summary>
6161
private void OnValidate()
6262
{
63-
if (FindObjectUtility.FindObjectsByType<TrackedPoseDriverLookup>(false, false).Length > 1)
63+
if (FindObjectsByType<TrackedPoseDriverLookup>(FindObjectsSortMode.None).Length > 1)
6464
{
6565
Debug.LogWarning("Found more than one instance of the ControllerLookup class in the hierarchy. There should only be one");
6666
}

0 commit comments

Comments
 (0)