Skip to content

Commit 175a292

Browse files
MaxWang-MSRogPodgekeveleigh
committed
Various configurator improvements
Co-Authored-By: RogPodge <[email protected]> Co-Authored-By: Kurtis <[email protected]>
1 parent 402fc71 commit 175a292

File tree

6 files changed

+34
-37
lines changed

6 files changed

+34
-37
lines changed

Assets/MRTK/Core/Inspectors/MRTK.Inspectors.asmdef

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
"Microsoft.MixedReality.Toolkit.Editor.ClassExtensions",
88
"Microsoft.MixedReality.Toolkit.Editor.Utilities",
99
"Unity.TextMeshPro.Editor",
10-
"Unity.TextMeshPro",
11-
"Unity.XR.Management",
12-
"Unity.XR.Management.Editor"
10+
"Unity.TextMeshPro"
1311
],
1412
"optionalUnityReferences": [],
1513
"includePlatforms": [
@@ -21,12 +19,6 @@
2119
"precompiledReferences": [],
2220
"autoReferenced": true,
2321
"defineConstraints": [],
24-
"versionDefines": [
25-
{
26-
"name": "com.microsoft.mixedreality.openxr",
27-
"expression": "",
28-
"define": "MSFT_OPENXR"
29-
}
30-
],
22+
"versionDefines": [],
3123
"noEngineReferences": false
3224
}

Assets/MRTK/Core/Inspectors/MixedRealityToolkitHelpLinks.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class MixedRealityToolkitHelpLinks : MonoBehaviour
1515
internal const string MRTKDocsUrl = "https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/";
1616
internal const string MRTKAPIRefUrl = "https://docs.microsoft.com/dotnet/api/microsoft.mixedreality.toolkit";
1717

18-
1918
[MenuItem("Mixed Reality/Toolkit/Help/Show Documentation", false)]
2019
public static void ShowDocumentation()
2120
{

Assets/MRTK/Core/Inspectors/Setup/MixedRealityEditorSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static void LogConfigurationWarnings()
106106
{
107107
if (!XRSettingsUtilities.XREnabled)
108108
{
109-
Debug.LogWarning("There is no prperly configured XR pipeline in the project! Please run the configurator by clicking on Mixed Reality (menu bar) -> Toolkit -> Utilities -> Configure Project for MRTK if the current settings are not desired.");
109+
Debug.LogWarning("There is no properly configured XR pipeline in the project! Please run the configurator by clicking on Mixed Reality (menu bar) -> Toolkit -> Utilities -> Configure Project for MRTK if the current settings are not desired.");
110110
}
111111

112112
if (!MixedRealityOptimizeUtils.IsOptimalRenderingPath())

Assets/MRTK/Core/Inspectors/Setup/MixedRealityProjectConfiguratorWindow.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ public class MixedRealityProjectConfiguratorWindow : EditorWindow
1919
{
2020
private const float Default_Window_Height = 500.0f;
2121
private const float Default_Window_Width = 300.0f;
22-
private const string XRPipelineDocsUrl = "Pipeline docs not yet available";
22+
private const string XRPipelineDocsUrl = "https://docs.microsoft.com/windows/mixed-reality/develop/unity/choosing-unity-version"; // Putting the generic MR docs on Unity versions/pipelines here before the MRTK XR pipeline doc is published.
2323
private const string XRSDKUnityDocsUrl = "https://docs.unity3d.com/Manual/configuring-project-for-xr.html";
2424
private const string MSOpenXRPluginUrl = "https://aka.ms/openxr-unity-install";
2525
private const string XRPipelineIntro = "To build applications for AR/VR headsets you need to enable an XR pipeline. ";
2626
private const string AlternativePipelineText = "\n\nFor more information on alternative pipelines, please click on the Learn More button.";
2727
private readonly GUIContent ApplyButtonContent = new GUIContent("Apply", "Apply configurations to this Unity Project");
28-
private readonly GUIContent SkipButtonContent = new GUIContent("Skip", "Skip to next step");
29-
private readonly GUIContent LaterButtonContent = new GUIContent("Later", "Do not show this pop-up notification until next session");
30-
private readonly GUIContent IgnoreButtonContent = new GUIContent("Ignore", "Modify this preference under Edit > Project Settings > Mixed Reality Toolkit");
28+
private readonly GUIContent SkipButtonContent = new GUIContent("Skip This Step", "Skip to the next step");
29+
private readonly GUIContent LaterButtonContent = new GUIContent("Skip Setup Until Next Session", "Do not show this configurator until next session");
30+
private readonly GUIContent IgnoreButtonContent = new GUIContent("Always Skip Setup", "This configurator will not show up again unless manually launched by clicking Mixed Reality (menu bar) -> Toolkit -> Utilities -> Configure Project for MRTK\nor this preference modified under Edit -> Project Settings -> Mixed Reality Toolkit");
3131
private GUIStyle multiLineButtonStyle;
3232

3333
private static ConfigurationStage currentStage
@@ -48,7 +48,7 @@ private static ConfigurationStage currentStage
4848
private void OnEnable()
4949
{
5050
Instance = this;
51-
EditorApplication.projectChanged += resetNullableBoolState;
51+
EditorApplication.projectChanged += ResetNullableBoolState;
5252
#if UNITY_2019_3_OR_NEWER
5353
CompilationPipeline.compilationStarted += CompilationPipeline_compilationStarted;
5454
#else
@@ -59,10 +59,10 @@ private void OnEnable()
5959

6060
private void CompilationPipeline_compilationStarted(object obj)
6161
{
62-
resetNullableBoolState();
62+
ResetNullableBoolState();
6363
}
6464

65-
private static void resetNullableBoolState()
65+
private static void ResetNullableBoolState()
6666
{
6767
#if UNITY_2019_3_OR_NEWER
6868
isMRTKExamplesPackageImportedViaUPM = null;
@@ -231,6 +231,7 @@ private void RenderNoPipeline()
231231
{
232232
XRSettingsUtilities.LegacyXREnabled = true;
233233
}
234+
CreateSpace(15);
234235
if (GUILayout.Button("\n<b>XR SDK/XR Management</b><size=4>\n\n</size>"
235236
+ "Choose this if you want to have a smoother upgrade path to Unity 2020. Supports HoloLens and Windows Mixed Reality/Oculus headsets. Note: do NOT choose this if you anticipate using Azure Spatial Anchors as there is a known compatibility issue.\n", multiLineButtonStyle))
236237
{
@@ -374,7 +375,7 @@ private void RenderSelectXRSDKPlugin()
374375
}
375376
CreateSpace(15);
376377
if (GUILayout.Button("\n<b>Built-in Unity plugins (non-OpenXR)</b><size=4>\n\n</size>"
377-
+ "Choose this if your application needs to support platforms beyond just HoloLens 2 and Windows Mixed Reality headsets (e.g. needs to support Oculus/Magic Leap headsets) today.\n", multiLineButtonStyle))
378+
+ "Choose this if your application needs to support platforms beyond just HoloLens 2 and Windows Mixed Reality headsets (e.g. Oculus/Magic Leap headsets which are currently not supported via OpenXR).\n", multiLineButtonStyle))
378379
{
379380
#if UNITY_2019_3_OR_NEWER
380381
if (!XRSettingsUtilities.XRManagementPresent)
@@ -410,8 +411,8 @@ private void RenderEnableXRSDKBuiltinPlugin()
410411

411412
EditorGUILayout.LabelField("To enable the XR SDK pipeline with built-in Plugins (non-OpenXR), follow the steps below:"
412413
+ "\n\n1. Press the Show Settings button."
413-
+ "\n2. In the XR management plug-in window that shows up, switch to the current build target (e.g. UWP, Windows standalone) tab by clicking on the corresponding icon right below the XR Plug-in Management title. "
414-
+ "\n3. Check the plugin(s) you want to use based on your target device. "
414+
+ "\n2. In the XR management plug-in window that shows up, switch to the current build target (e.g. UWP, Windows standalone) tab by clicking on the corresponding icon right below the XR Plug-in Management title."
415+
+ "\n3. Check the plugin(s) you want to use based on your target device."
415416
+ "\n\nA new page confirming the setup is successful will be shown in place of this page once you finish the steps."
416417
+ $"\n\nFor more information, please click on the Learn More button. (Only the first three steps are needed if following instructions on the page)", EditorStyles.wordWrappedLabel);
417418

@@ -442,9 +443,11 @@ private void RenderEnableOpenXRPlugin()
442443
}
443444
EditorGUILayout.LabelField("XR Pipeline Setting - Enabling the XR SDK Pipeline with OpenXR", EditorStyles.boldLabel);
444445

445-
EditorGUILayout.LabelField("To enable the XR SDK pipeline with OpenXR, first press the Show Settings button. "
446-
+ $"\n\nIn the XR management plug-in window that shows up, please switch to the correct build target (e.g. UWP, Windows standalone) tab first by clicking on the icon(s) right below the XR Plug-in Management title. "
447-
+ "Then please check the OpenXR plugin. A new page confirming the detection of OpenXR will be shown in place of this page once you finish the steps.", EditorStyles.wordWrappedLabel);
446+
EditorGUILayout.LabelField("To enable the XR SDK pipeline with OpenXR follow the instructions below."
447+
+ "\n\n1. Press the Show Settings button."
448+
+ "\n2. In the XR management plug-in window that shows up, please switch to the correct build target (e.g. UWP, Windows standalone) tab by clicking on the icon(s) right below the XR Plug-in Management title."
449+
+ "\n3. Check the checkbox for OpenXR plugin. A new page confirming the detection of OpenXR will be shown in place of this page once you finish the steps."
450+
, EditorStyles.wordWrappedLabel);
448451
CreateSpace(15);
449452
if (GUILayout.Button("Show XR Plug-in Management Settings"))
450453
{
@@ -467,12 +470,12 @@ private void RenderEnableMicrosoftOpenXRPlugin()
467470
EditorGUILayout.LabelField("XR Pipeline Setting - Installing the Microsoft OpenXR plugin", EditorStyles.boldLabel);
468471

469472
EditorGUILayout.LabelField("To target HoloLens 2 or HP Reverb G2 headset you need to install the Microsoft OpenXR plugin by following the instructions below."
470-
+ "\n\n1. Press the Show instructions button."
473+
+ "\n\n1. Press the Show Instructions button."
471474
+ "\n2. Follow the instructions in the Manual setup without MRTK section as MRTK is already in the project. Also you do not need to manually select MRTK in the feature tool no matter it is shown as installed or not."
472475
+ "\n3. Keep this window and the Unity project open during the process. A new page confirming the setup is successful will be shown in place of this page once you finish the steps."
473476
, EditorStyles.wordWrappedLabel);
474477
CreateSpace(15);
475-
if (GUILayout.Button("Show instructions"))
478+
if (GUILayout.Button("Show Instructions"))
476479
{
477480
Application.OpenURL(MSOpenXRPluginUrl);
478481
}
@@ -566,7 +569,7 @@ private void RenderShowUPMExamples()
566569
}
567570
EditorGUILayout.LabelField("Locating MRTK Examples", EditorStyles.boldLabel);
568571

569-
EditorGUILayout.LabelField("The MRTK Examples package includes samples to help you familiarize yourself with many core features. "
572+
EditorGUILayout.LabelField("The MRTK Examples package includes samples to help you familiarize yourself with many core features."
570573
+ "\nSince you imported MRTK via MRFT/UPM the examples no longer show up in the Assets folder automatically. They are now located at Window (menu bar) -> Package Manager "
571574
+ "-> Select In Project in the \"Packages:\" dropdown -> Mixed Reality Toolkit Examples", EditorStyles.wordWrappedLabel);
572575
CreateSpace(15);
@@ -593,8 +596,8 @@ private void RenderConfigurationCompleted()
593596
GUILayout.Label("MRTK Setup Completed!", MixedRealityStylesUtility.BoldLargeTitleStyle);
594597
CreateSpace(5);
595598
EditorGUILayout.LabelField("You have finished setting up the project for Mixed Reality Toolkit. You may go through this process again by clicking on Mixed Reality (menu bar) -> Toolkit -> Utilities -> Configure Project for MRTK"
596-
+ $"\n\nIf there are certain settings not set according to the recommendation you may see this configurator pops up again. Use the Ignore or Later button to suppress this behavior. "
597-
+ "\n\nWe hope you enjoy using MRTK. Please find the links to our documentation and API references below. If you encountered something looking like a bug please report by opening an issue in our repository. "
599+
+ $"\n\nIf there are certain settings not set according to the recommendation you may see this configurator pops up again. Use the Ignore or Later button to suppress this behavior."
600+
+ "\n\nWe hope you enjoy using MRTK. Please find the links to our documentation and API references below. If you encountered something looking like a bug please report by opening an issue in our repository."
598601
+ "\n\nThese links are accessible through Mixed Reality (menu bar) -> Toolkit -> Help.", EditorStyles.wordWrappedLabel);
599602
CreateSpace(15);
600603
using (new EditorGUILayout.HorizontalScope())
@@ -620,9 +623,6 @@ private void RenderSetupLaterSection(bool showSkipButton = false, Action skipBut
620623
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
621624
EditorGUILayout.LabelField("Not ready to setup the project now?", EditorStyles.boldLabel);
622625

623-
EditorGUILayout.LabelField(showSkipButton ? "You may choose to skip this step, delay the setup until next session or ignore the setup unless reenabled." :
624-
"You may choose to setup the project in the next session or ignore the setup for future sessions."
625-
, EditorStyles.wordWrappedLabel);
626626
CreateSpace(15);
627627
using (new EditorGUILayout.HorizontalScope())
628628
{

Assets/MRTK/Core/Utilities/Editor/ConfigurationStage.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4+
using System.Runtime.CompilerServices;
5+
6+
[assembly: InternalsVisibleTo("Microsoft.MixedReality.Toolkit.Editor.Inspectors")]
47
namespace Microsoft.MixedReality.Toolkit.Utilities.Editor
58
{
6-
public enum ConfigurationStage
9+
/// <summary>
10+
/// List of the stages of the project configurator
11+
/// </summary>
12+
internal enum ConfigurationStage
713
{
814
Init = 0,
915
SelectXRSDKPlugin = 100,

Assets/MRTK/Core/Utilities/Editor/Preferences/MixedRealityProjectPreferences.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static bool IgnoreSettingsPrompt
6767

6868
#endregion Ignore startup settings prompt
6969

70-
#region Ignore startup settings prompt
70+
#region Configurator state
7171

7272
private const string CONFIG_KEY = "_MixedRealityToolkit_Editor_ConfiguratorState";
7373
private static bool configuratorStateLoaded;
@@ -76,7 +76,7 @@ public static bool IgnoreSettingsPrompt
7676
/// <summary>
7777
/// Should the project configurator show when the project isn't configured according to MRTK's recommendations?
7878
/// </summary>
79-
public static ConfigurationStage ConfiguratorState
79+
internal static ConfigurationStage ConfiguratorState
8080
{
8181
get
8282
{
@@ -91,7 +91,7 @@ public static ConfigurationStage ConfiguratorState
9191
set => ProjectPreferences.Set(CONFIG_KEY, configuratorSate = (int)value);
9292
}
9393

94-
#endregion Ignore startup settings prompt
94+
#endregion Configurator state
9595

9696
#region Auto-Enable UWP Capabilities
9797

0 commit comments

Comments
 (0)