Skip to content

Commit 8ba4bc9

Browse files
committed
Configurator fixes
1 parent 9d1037d commit 8ba4bc9

File tree

6 files changed

+119
-61
lines changed

6 files changed

+119
-61
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
using UnityEditor;
5+
using UnityEngine;
6+
7+
namespace Microsoft.MixedReality.Toolkit.Editor
8+
{
9+
/// <summary>
10+
/// Creates menu items to show users how to get help
11+
/// </summary>
12+
public class MixedRealityToolkitHelpLinks : MonoBehaviour
13+
{
14+
internal const string MRTKIssuePageUrl = "https://github.com/microsoft/MixedRealityToolkit-Unity/issues";
15+
internal const string MRTKDocsUrl = "https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/";
16+
internal const string MRTKAPIRefUrl = "https://docs.microsoft.com/dotnet/api/microsoft.mixedreality.toolkit";
17+
18+
19+
[MenuItem("Mixed Reality/Toolkit/Help/Show Documentation", false)]
20+
public static void ShowDocumentation()
21+
{
22+
Application.OpenURL(MRTKDocsUrl);
23+
}
24+
[MenuItem("Mixed Reality/Toolkit/Help/Show API Reference", false)]
25+
public static void ShowAPIReference()
26+
{
27+
Application.OpenURL(MRTKAPIRefUrl);
28+
}
29+
[MenuItem("Mixed Reality/Toolkit/Help/File a bug report", false)]
30+
public static void FileBugReport()
31+
{
32+
Application.OpenURL(MRTKIssuePageUrl);
33+
}
34+
}
35+
}

Assets/MRTK/Core/Inspectors/MixedRealityToolkitHelpLinks.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ 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 = "https://";
23-
private const string XRSDKUnityDocsUrl = "https://";
24-
private const string MRFTDocsUrl = "https://docs.microsoft.com/windows/mixed-reality/develop/unity/welcome-to-mr-feature-tool";
22+
private const string XRPipelineDocsUrl = "TO DO";
23+
private const string XRSDKUnityDocsUrl = "https://docs.unity3d.com/Manual/configuring-project-for-xr.html";
2524
private readonly GUIContent ApplyButtonContent = new GUIContent("Apply", "Apply configurations to this Unity Project");
2625
private readonly GUIContent SkipButtonContent = new GUIContent("Skip", "Skip to next step");
2726
private readonly GUIContent LaterButtonContent = new GUIContent("Later", "Do not show this pop-up notification until next session");
@@ -58,19 +57,17 @@ private void OnEnable()
5857
private void CompilationPipeline_compilationStarted(object obj)
5958
{
6059
resetNullableBoolState();
61-
// There should be only one pop-up window which is generally tracked by IsOpen
62-
// However, when recompiling, Unity will call OnDestroy for this window but not actually destroy the editor window
63-
// This ensure we have a clean close on recompiles when this EditorWindow was open beforehand
64-
//ShowWindow();
6560
}
6661

6762
private static void resetNullableBoolState()
6863
{
64+
#if UNITY_2019_3_OR_NEWER
6965
isMRTKExamplesPackageImportedViaUPM = null;
66+
#endif
7067
isTMPEssentialsImported = null;
7168
}
7269

73-
[MenuItem("Ut/Configure Demo", false, 499)]
70+
[MenuItem("Mixed Reality/Toolkit/Utilities/Run Configurator...", false, 499)]
7471
public static void ShowWindowFromMenu()
7572
{
7673
currentStage = ConfigurationStage.Init;
@@ -109,9 +106,9 @@ private void OnGUI()
109106
if (currentStage != ConfigurationStage.Done)
110107
{
111108
EditorGUILayout.LabelField("Welcome to MRTK!", MixedRealityStylesUtility.BoldLargeTitleStyle);
112-
createSpace(5);
109+
CreateSpace(5);
113110
EditorGUILayout.LabelField("This configurator will go through some settings to make sure the project is ready for MRTK.");
114-
createSpace(20);
111+
CreateSpace(20);
115112
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
116113
}
117114

@@ -198,7 +195,7 @@ private void RenderNoPipeline()
198195
#endif // UNITY_2019_3_OR_NEWER
199196
+ "You may also skip this step and configure manually later. "
200197
+ $"More information can be found at {XRPipelineDocsUrl}", EditorStyles.wordWrappedLabel);
201-
createSpace(15);
198+
CreateSpace(15);
202199
using (new EditorGUILayout.HorizontalScope())
203200
{
204201
#if UNITY_2019_3_OR_NEWER
@@ -235,7 +232,7 @@ private void RenderLegacyXRPipelineDetected()
235232
EditorGUILayout.LabelField("To build applications targeting AR/VR headsets you need to specify an XR pipeline. "
236233
+ $"\n\nThe LegacyXR pipeline is detected in the project. Please be aware that the LegacyXR pipeline is deprecated in Unity 2019 and is removed in Unity 2020."
237234
+ $"\n\nFor more information on alternative pipelines, please visit {XRPipelineDocsUrl}", EditorStyles.wordWrappedLabel);
238-
createSpace(15);
235+
CreateSpace(15);
239236
using (new EditorGUILayout.HorizontalScope())
240237
{
241238
if (GUILayout.Button("Next"))
@@ -257,7 +254,7 @@ private void RenderMicrosoftOpenXRPipelineDetected()
257254
EditorGUILayout.LabelField("To build applications targeting AR/VR headsets you need to specify an XR pipeline. "
258255
+ $"\n\nThe XR SDK pipeline with Unity and Microsoft OpenXR plugins are detected in the project. You are good to go."
259256
+ $"\n\nFor more information on alternative pipelines, please visit {XRPipelineDocsUrl}", EditorStyles.wordWrappedLabel);
260-
createSpace(15);
257+
CreateSpace(15);
261258
using (new EditorGUILayout.HorizontalScope())
262259
{
263260
if (GUILayout.Button("Next"))
@@ -279,17 +276,17 @@ private void RenderOpenXRPipelineDetected()
279276
EditorGUILayout.LabelField("XR Pipeline Setting - XR SDK with Unity OpenXR plugin in use", EditorStyles.boldLabel);
280277
EditorGUILayout.LabelField("To build applications targeting AR/VR headsets you need to specify an XR pipeline. "
281278
+ $"\n\nThe XR SDK pipeline with Unity OpenXR plugin is detected in the project. You are good to go."
282-
+ $"\n\nNote: If you are targeting HoloLens 2 or HP Reverb G2 headset you need to click on the Acquire Microsoft OpenXR plugin button and follow the instructions."
279+
+ $"\n\nNote: If you are targeting HoloLens 2 or HP Reverb G2 headset you need to click on the more info button and follow the instructions there."
283280
+ $"\n\nFor more information on alternative pipelines, please visit {XRPipelineDocsUrl}", EditorStyles.wordWrappedLabel);
284-
createSpace(15);
281+
CreateSpace(15);
285282
using (new EditorGUILayout.HorizontalScope())
286283
{
287284
if (GUILayout.Button("Next"))
288285
{
289286
currentStage = ConfigurationStage.ProjectConfiguration;
290287
Repaint();
291288
}
292-
if (GUILayout.Button("Acquire Microsoft OpenXR plugin"))
289+
if (GUILayout.Button("More info on HoloLens 2 and Reverb G2"))
293290
{
294291
currentStage = ConfigurationStage.InstallMSOpenXR;
295292
Repaint();
@@ -309,7 +306,7 @@ private void RenderXRSDKBuiltinPluginPipelineDetected()
309306
EditorGUILayout.LabelField("To build applications targeting AR/VR headsets you need to specify an XR pipeline. "
310307
+ $"\n\nThe XR SDK pipeline with builtin plugin is detected in the project. You are good to go."
311308
+ $"\n\nFor more information on alternative pipelines, please visit {XRPipelineDocsUrl}", EditorStyles.wordWrappedLabel);
312-
createSpace(15);
309+
CreateSpace(15);
313310
using (new EditorGUILayout.HorizontalScope())
314311
{
315312
if (GUILayout.Button("Next"))
@@ -338,7 +335,7 @@ private void RenderSelectXRSDKPlugin()
338335
+ $"\n\nThe Unity OpenXR plugin (possibly along with vender-specific extension plugins) is recommended if you are targeting HoloLens 2 and/or Windows Mixed Reality (WMR) headsets."
339336
+ "\nThe built-in plugins provided by Unity offers a wide range of supported devices, including HoloLens 2 and WMR headsets. "
340337
+ $"\n\nMore information can be found at {XRPipelineDocsUrl}.", EditorStyles.wordWrappedLabel);
341-
createSpace(15);
338+
CreateSpace(15);
342339
using (new EditorGUILayout.HorizontalScope())
343340
{
344341
if (GUILayout.Button("Use the Unity OpenXR plugin"))
@@ -394,7 +391,7 @@ private void RenderEnableXRSDKBuiltinPlugin()
394391
+ $"\n\nMore information can be found at {XRSDKUnityDocsUrl} (Only the first three steps are needed if following instructions on the page)", EditorStyles.wordWrappedLabel);
395392
}
396393

397-
createSpace(15);
394+
CreateSpace(15);
398395
using (new EditorGUILayout.HorizontalScope())
399396
{
400397
if (GUILayout.Button("Show Settings"))
@@ -432,7 +429,7 @@ private void RenderEnableOpenXRPlugin()
432429
EditorGUILayout.LabelField("To enable the XR SDK pipeline with OpenXR, first press the Show Settings button. "
433430
+ $"\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. "
434431
+ "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);
435-
createSpace(15);
432+
CreateSpace(15);
436433
if (GUILayout.Button("Show XR Plug-in Management Settings"))
437434
{
438435
SettingsService.OpenProjectSettings("Project/XR Plug-in Management");
@@ -451,14 +448,14 @@ private void RenderEnableMicrosoftOpenXRPlugin()
451448
currentStage = ConfigurationStage.Init;
452449
Repaint();
453450
}
454-
EditorGUILayout.LabelField("XR Pipeline Setting - Enabling the Microsoft OpenXR Plugin", EditorStyles.boldLabel);
451+
EditorGUILayout.LabelField("XR Pipeline Setting - Configurating OpenXR for HoloLens 2 and HP Reverb G2", EditorStyles.boldLabel);
455452
//createSpace();
456-
EditorGUILayout.LabelField("The Microsoft OpenXR plugin is required if you are targeting HoloLens 2 or HP Reverb G2 headset. You may skip this step if that is not the case for you."
453+
EditorGUILayout.LabelField("To target HoloLens 2 or HP Reverb G2 headset you need to follow the instructions below."
457454
+ $"\n\nFirst click on the Show XR Plug-in Management Settings button. In the window popping up/getting focus, switch to switch to the correct build target (i.e. UWP or Windows standalone) tab "
458-
+ "by clicking on the icon(s) right below the XR Plug-in Management title. Then you should click on the question mark sign to the right of the \"Enable HoloLens 2 feature set\" chekcbox."
459-
+ "\n\nFollow the \"Manual setup without MRTK\" section of the instructions as MRTK is already in the project. Also note you do not need to manually select MRTK in the feature tool no matter it is shown as installed or not."
460-
+ "\n\nKeep this window and the Unity project open during the process. A new page confirming the detection of the Microsoft OpenXR plugin will be shown in place of this page once you finish the steps.", EditorStyles.wordWrappedLabel);
461-
createSpace(15);
455+
+ "by clicking on the icon(s) right below the XR Plug-in Management title. Then you should hover on the question mark to the right of the \"Enable HoloLens 2 feature set\" chekcbox and follow the instructions there."
456+
+ "\n\nNote: Follow the \"Manual setup without MRTK\" section of the instructions on the web page 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."
457+
+ "\n\nKeep 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.", EditorStyles.wordWrappedLabel);
458+
CreateSpace(15);
462459
if (GUILayout.Button("Show XR Plug-in Management Settings"))
463460
{
464461
SettingsService.OpenProjectSettings("Project/XR Plug-in Management");
@@ -488,12 +485,12 @@ private void RenderConfiguredConfirmation()
488485
const string dialogTitle = "Project Configuration Confirmed";
489486
const string dialogContent = "This Unity project is properly configured for the Mixed Reality Toolkit. All items shown above are using recommended settings.";
490487

491-
createSpace(15);
488+
CreateSpace(15);
492489
EditorGUILayout.LabelField(dialogTitle, EditorStyles.boldLabel);
493-
createSpace(15);
490+
CreateSpace(15);
494491
EditorGUILayout.LabelField(dialogContent);
495492

496-
createSpace(10);
493+
CreateSpace(10);
497494
if (GUILayout.Button("Next"))
498495
{
499496
currentStage = ConfigurationStage.ImportTMP;
@@ -507,12 +504,12 @@ private void RenderChoiceDialog()
507504
const string dialogTitle = "Apply Default Settings?";
508505
const string dialogContent = "The Mixed Reality Toolkit would like to auto-apply useful settings to this Unity project. Enabled options above will be applied to the project. Disabled items are already properly configured.";
509506

510-
createSpace(15);
507+
CreateSpace(15);
511508
EditorGUILayout.LabelField(dialogTitle, EditorStyles.boldLabel);
512-
createSpace(15);
509+
CreateSpace(15);
513510
EditorGUILayout.LabelField(dialogContent);
514511

515-
createSpace(10);
512+
CreateSpace(10);
516513
if (GUILayout.Button(ApplyButtonContent))
517514
{
518515
ApplyConfigurations();
@@ -534,10 +531,10 @@ private void RenderImportTMP()
534531
EditorGUILayout.LabelField("Importing TMP Essentials", EditorStyles.boldLabel);
535532

536533
EditorGUILayout.LabelField("MRTK contains components that depend on TextMeshPro. It is recommended that you import TMP by clicking the Import TMP Essentials button below.", EditorStyles.wordWrappedLabel);
537-
createSpace(15);
534+
CreateSpace(15);
538535
var m_ResourceImporter = new TMP_PackageResourceImporter();
539536
m_ResourceImporter.OnGUI();
540-
createSpace(15);
537+
CreateSpace(15);
541538
RenderSetupLaterSection(true, () => {
542539
currentStage = ConfigurationStage.ShowExamples;
543540
Repaint();
@@ -556,7 +553,7 @@ private void RenderShowUPMExamples()
556553
EditorGUILayout.LabelField("The MRTK Examples package includes samples to help you familiarize yourself with many core features. "
557554
+ "\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 "
558555
+ "-> Select In Project in the \"Packages:\" dropdown -> Mixed Reality Toolkit Examples", EditorStyles.wordWrappedLabel);
559-
createSpace(15);
556+
CreateSpace(15);
560557
using (new EditorGUILayout.HorizontalScope())
561558
{
562559
if (GUILayout.Button("Show me the examples"))
@@ -571,30 +568,28 @@ private void RenderShowUPMExamples()
571568
Repaint();
572569
}
573570
}
574-
createSpace(15);
571+
CreateSpace(15);
575572
RenderSetupLaterSection();
576573
}
577574

578575
private void RenderConfigurationCompleted()
579576
{
580577
EditorGUILayout.LabelField("MRTK Setup Completed!", MixedRealityStylesUtility.BoldLargeTitleStyle);
581-
createSpace(5);
582-
EditorGUILayout.LabelField("You have finished setting up the project for Mixed Reality Toolkit. You may go through this process again by clicking Mixed Reality Toolkit on the editor menu bar -> Ultilities -> Config."
583-
+ $"\nIf there are certain settings not set according to the recommendation you may see this configurator popping up again. You may use the Ignore or Later button to suppress the behavior. "
584-
+ "We 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. "
585-
+ "\nThese links are accessible through Mixed Reality Toolkit on the editor menu bar -> Help "
586-
+ $"After finishing the process in the feature tool come back here to verify whether the installation is successful. A new page should be shown if you succeeded."
587-
+ $"\n\nMore information can be found at {MRFTDocsUrl}.", EditorStyles.wordWrappedLabel);
588-
createSpace(15);
578+
CreateSpace(5);
579+
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 -> Run Configurator..."
580+
+ $"\n\nIf there are certain settings not set according to the recommendation you may see this configurator popping up again. You may use the Ignore or Later button to suppress the behavior. "
581+
+ "\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. "
582+
+ "\n\nThese links are accessible through Mixed Reality (menu bar) -> Toolkit -> Help.", EditorStyles.wordWrappedLabel);
583+
CreateSpace(15);
589584
using (new EditorGUILayout.HorizontalScope())
590585
{
591586
if (GUILayout.Button("Show MRTK Documentation"))
592587
{
593-
Application.OpenURL(MRFTDocsUrl);
588+
Application.OpenURL(MixedRealityToolkitHelpLinks.MRTKDocsUrl);
594589
}
595590
if (GUILayout.Button("Show MRTK API References"))
596591
{
597-
Application.OpenURL(MRFTDocsUrl);
592+
Application.OpenURL(MixedRealityToolkitHelpLinks.MRTKAPIRefUrl);
598593
}
599594
if (GUILayout.Button("Done"))
600595
{
@@ -612,7 +607,7 @@ private void RenderSetupLaterSection(bool showSkipButton = false, Action skipBut
612607
EditorGUILayout.LabelField(showSkipButton ? "You may choose to skip this step, delay the setup until next session or ignore the setup unless reenabled." :
613608
"You may choose to delay the setup until next session or ignore the setup unless reenabled."
614609
, EditorStyles.wordWrappedLabel);
615-
createSpace(15);
610+
CreateSpace(15);
616611
using (new EditorGUILayout.HorizontalScope())
617612
{
618613
if (showSkipButton)
@@ -635,7 +630,7 @@ private void RenderSetupLaterSection(bool showSkipButton = false, Action skipBut
635630
Close();
636631
}
637632
}
638-
createSpace(15);
633+
CreateSpace(15);
639634
}
640635

641636
private bool TMPEssentialsImported()
@@ -863,7 +858,7 @@ private void RenderToggle(MRConfig configKey, string title)
863858
}
864859
}
865860

866-
private void createSpace(float width)
861+
private void CreateSpace(float width)
867862
{
868863
#if UNITY_2019_3_OR_NEWER
869864
EditorGUILayout.Space(width);

0 commit comments

Comments
 (0)