Skip to content

Commit f4b6f81

Browse files
committed
Merge branch 'prerelease/2.6.0_stabilization' of https://github.com/microsoft/MixedRealityToolkit-Unity into ExamplesHub_2.6.0
2 parents 4533679 + 3be2f3a commit f4b6f81

File tree

13 files changed

+310
-99
lines changed

13 files changed

+310
-99
lines changed

Assets/MRTK/Examples/Demos/Input/Scenes/InputActions/InputActions.MixedRealityInputSimulationProfile.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ MonoBehaviour:
3434
currentControlMode: 0
3535
fastControlKey:
3636
bindingType: 2
37-
code: 305
37+
code: 303
3838
controlSlowSpeed: 1
3939
controlFastSpeed: 5
4040
moveHorizontal: Horizontal

Assets/MRTK/Examples/Demos/Input/Scenes/PrimaryPointer/PrimaryPointerHandlerExample.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,19 @@ private void OnPrimaryPointerChanged(IMixedRealityPointer oldPointer, IMixedReal
2424
{
2525
if (newPointer != null)
2626
{
27-
Transform parentTransform = newPointer.BaseCursor.TryGetMonoBehaviour(out MonoBehaviour baseCursor) ? baseCursor.transform : null;
27+
Transform parentTransform = null;
28+
29+
// For this example scene, use special logic if a GGVPointer becomes the primary pointer.
30+
// In particular, the GGV pointer defers its cursor management to the GazeProvider, which has its own internal pointer definition as well
31+
// In the future, the pointer/cursor relationship will be reworked and standardized to remove this awkward set of co-dependencies
32+
if (newPointer is GGVPointer)
33+
{
34+
parentTransform = CoreServices.InputSystem.GazeProvider.GazePointer.BaseCursor.TryGetMonoBehaviour(out MonoBehaviour baseCursor) ? baseCursor.transform : null;
35+
}
36+
else
37+
{
38+
parentTransform = newPointer.BaseCursor.TryGetMonoBehaviour(out MonoBehaviour baseCursor) ? baseCursor.transform : null;
39+
}
2840

2941
// If there's no cursor try using the controller pointer transform instead
3042
if (parentTransform == null)

Assets/MRTK/Examples/Demos/ReadingMode/Scripts/ReadingModeSceneBehavior.cs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
using Microsoft.MixedReality.Toolkit.CameraSystem;
55
using Microsoft.MixedReality.Toolkit.UI;
66
using UnityEngine;
7+
8+
#if UNITY_2019_3_OR_NEWER
9+
using Microsoft.MixedReality.Toolkit.Utilities;
10+
#endif // UNITY_2019_3_OR_NEWER
11+
12+
#if !UNITY_2020_1_OR_NEWER
713
using UnityEngine.XR;
14+
#endif // !UNITY_2020_1_OR_NEWER
815

916
namespace Microsoft.MixedReality.Toolkit.Examples.Demos.ReadingMode
1017
{
@@ -16,12 +23,32 @@ public class ReadingModeSceneBehavior : MonoBehaviour
1623
[SerializeField]
1724
private PinchSlider renderViewportScaleSlider = null;
1825

26+
private float previousSliderValue = -1;
27+
private const float MinScale = 0.001f;
28+
1929
private void Update()
2030
{
21-
if (renderViewportScaleSlider != null)
31+
if (renderViewportScaleSlider == null || renderViewportScaleSlider.SliderValue == previousSliderValue)
32+
{
33+
return;
34+
}
35+
36+
previousSliderValue = renderViewportScaleSlider.SliderValue;
37+
38+
#if UNITY_2019_3_OR_NEWER
39+
if (XRSubsystemHelpers.DisplaySubsystem != null)
40+
{
41+
XRSubsystemHelpers.DisplaySubsystem.scaleOfAllViewports = Mathf.Max(renderViewportScaleSlider.SliderValue, MinScale);
42+
return;
43+
}
44+
#endif // UNITY_2019_3_OR_NEWER
45+
46+
#if !UNITY_2020_1_OR_NEWER
47+
if (XRDevice.isPresent)
2248
{
23-
XRSettings.renderViewportScale = renderViewportScaleSlider.SliderValue;
49+
XRSettings.renderViewportScale = Mathf.Max(renderViewportScaleSlider.SliderValue, MinScale);
2450
}
51+
#endif // !UNITY_2020_1_OR_NEWER
2552
}
2653

2754
public void EnableReadingMode()

Assets/MRTK/Tools/MSBuild/Scripts/AssetScriptReferenceRetargeter.cs

Lines changed: 249 additions & 82 deletions
Large diffs are not rendered by default.

Assets/MRTK/Tools/MSBuild/Scripts/Utilities.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public static class Utilities
5656
public static string MSBuildOutputFolder { get; } = GetNormalizedPath(ProjectPath + MSBuildFolderName, true);
5757
public static string PackagesCopyPath { get; } = Path.Combine(MSBuildOutputFolder, PackagesCopyFolderName);
5858
public const string MetaFileGuidRegex = @"guid:\s*([0-9a-fA-F]{32})";
59+
public const string MetaFileIdRegex = @"fileID:\s*(-?[0-9]+)";
5960

6061
private static readonly string packagesPath;
6162

@@ -118,7 +119,7 @@ public static bool TryGetGuidForAsset(FileInfo assetPath, out Guid guid)
118119
while (!reader.EndOfStream)
119120
{
120121
string line = reader.ReadLine();
121-
Match match = Regex.Match(line, Utilities.MetaFileGuidRegex);
122+
Match match = Regex.Match(line, MetaFileGuidRegex);
122123

123124
if (match.Success)
124125
{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file is intentionally left blank. It will be filled in during the build pipeline. It exists to maintain a stable meta file and GUID.

Assets/MRTK/Tools/MSBuild/mrtk_guid_remapping_dictionary.txt.meta

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

Assets/MRTK/Tools/MixedReality.Toolkit.Tools.nuspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<file src="..\..\MRTK\Core\MixedReality.Toolkit.targets" target="build\Microsoft.MixedReality.Toolkit.Tools.targets" />
2828

2929
<file src="..\..\..\Plugins\**\Microsoft.MixedReality.Toolkit.Tools.*" target="Plugins\" />
30+
<file src="..\..\..\Plugins\**\Microsoft.MixedReality.Toolkit.MSBuild.*" target="Plugins\" />
3031
<file src="..\..\..\..\Assets\MRTK\Tools\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\Tools" />
3132
</files>
3233
</package>
31.4 KB
Loading

Documentation/Tools/HolographicRemoting.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,13 @@ These issues are particularly relevant when running on **Unity 2019.3** or later
3333

3434
#### Import DotNetWinRT into the project
3535

36-
1. Install a NuGet client
36+
1. Download the [Mixed Reality Feature Tool](https://aka.ms/MRFeatureTool)
3737

38-
> [!Note]
39-
> The following instructions presume use of [NuGet for Unity](https://github.com/GlitchEnzo/NuGetForUnity/releases)
38+
1. In the **Discover features** view, select *Mixed Reality WinRT Projections*
4039

41-
1. Navigate to the NuGet client UI
40+
![Select DotNetWinRT package](../images/tools/remoting/SelectDotNetWinRT.png)
4241

43-
![Launch NuGet UI](../Images/Tools/Remoting/LaunchNuGetForUnity.png)
44-
45-
1. Locate the `Microsoft.Windows.MixedReality.DotNetWinRT` package
46-
47-
![Locate Package](../Images/Tools/Remoting/LocateDotNetWinRT.png)
48-
49-
1. Select Install
42+
1. Click **Get Features** and continue to [import the package](https://docs.microsoft.com/windows/mixed-reality/develop/unity/welcome-to-mr-feature-tool#3-importing-feature-packages).
5043

5144
#### DOTNETWINRT_PRESENT define written into player settings
5245

0 commit comments

Comments
 (0)