Skip to content

Commit 3636b87

Browse files
Merge pull request #6680 from MenelvagorMilsom/ux/update-refactor-branch
Ux/update refactor branch
2 parents f643df1 + ae1c422 commit 3636b87

File tree

1,203 files changed

+342954
-15518
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,203 files changed

+342954
-15518
lines changed

.github/write-good.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
writeGood: false
2+
alex: false
3+
spellchecker: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Assets/TextMesh Pro/
6767
Assets/StreamingAssets/GltfModels/
6868
Assets/StreamingAssets/GltfModels.meta
6969
Assets/StreamingAssets.meta
70+
Assets/MixedRealityToolkit.Generated/*
7071

7172
/mrtk_log_mostRecentET.csv
7273

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
using System.Reflection;
5+
6+
[assembly: AssemblyVersion("2.2.0.0")]
7+
[assembly: AssemblyFileVersion("2.2.0.0")]
8+
9+
[assembly: AssemblyProduct("Microsoft® Mixed Reality Toolkit Examples")]
10+
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation")]

Assets/MixedRealityToolkit.Examples/Demos/UX/Interactables/Scripts/HideAfterEnabled.cs.meta renamed to Assets/MixedRealityToolkit.Examples/AssemblyInfo.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/MixedRealityToolkit.Examples/Demos/Audio/Scripts/LoFiFilterSelection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
99
{
1010
[RequireComponent(typeof(AudioLoFiEffect))]
11+
[AddComponentMenu("Scripts/MRTK/Examples/LoFiFilterSelection")]
1112
public class LoFiFilterSelection : MonoBehaviour, IMixedRealityPointerHandler
1213
{
1314
[Tooltip("Material used when the emitter is set to Narrow Band Telephony")]

Assets/MixedRealityToolkit.Examples/Demos/Boundary/Scripts/BoundaryVisualizationDemo.cs

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33

44
using Microsoft.MixedReality.Toolkit.Boundary;
55
using System.Collections.Generic;
6-
using Microsoft.MixedReality.Toolkit.Utilities;
76
using UnityEngine;
8-
using UnityBoundary = UnityEngine.Experimental.XR.Boundary;
97

108
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
119
{
1210
/// <summary>
1311
/// Demo class to show different ways of using the boundary system and visualizing the data.
1412
/// </summary>
13+
[AddComponentMenu("Scripts/MRTK/Examples/BoundaryVisualizationDemo")]
1514
public class BoundaryVisualizationDemo : MonoBehaviour, IMixedRealityBoundaryHandler
1615
{
1716
private GameObject markerParent;
@@ -32,20 +31,6 @@ public class BoundaryVisualizationDemo : MonoBehaviour, IMixedRealityBoundaryHan
3231
[SerializeField]
3332
private bool showBoundaryCeiling = true;
3433

35-
private IMixedRealityBoundarySystem boundarySystem = null;
36-
37-
private IMixedRealityBoundarySystem BoundarySystem
38-
{
39-
get
40-
{
41-
if (boundarySystem == null)
42-
{
43-
MixedRealityServiceRegistry.TryGetService<IMixedRealityBoundarySystem>(out boundarySystem);
44-
}
45-
return boundarySystem;
46-
}
47-
}
48-
4934
#region MonoBehaviour Implementation
5035

5136
private void Awake()
@@ -57,7 +42,7 @@ private void Awake()
5742

5843
private void Start()
5944
{
60-
if (BoundarySystem != null)
45+
if (CoreServices.BoundarySystem != null)
6146
{
6247
if (markers.Count == 0)
6348
{
@@ -68,24 +53,25 @@ private void Start()
6853

6954
private void Update()
7055
{
71-
if (BoundarySystem != null)
56+
if (CoreServices.BoundarySystem != null)
7257
{
73-
BoundarySystem.ShowFloor = showFloor;
74-
BoundarySystem.ShowPlayArea = showPlayArea;
75-
BoundarySystem.ShowTrackedArea = showTrackedArea;
76-
BoundarySystem.ShowBoundaryWalls = showBoundaryWalls;
77-
BoundarySystem.ShowBoundaryCeiling = showBoundaryCeiling;
58+
var boundarySystem = CoreServices.BoundarySystem;
59+
boundarySystem.ShowFloor = showFloor;
60+
boundarySystem.ShowPlayArea = showPlayArea;
61+
boundarySystem.ShowTrackedArea = showTrackedArea;
62+
boundarySystem.ShowBoundaryWalls = showBoundaryWalls;
63+
boundarySystem.ShowBoundaryCeiling = showBoundaryCeiling;
7864
}
7965
}
8066

8167
private void OnEnable()
8268
{
83-
BoundarySystem?.RegisterHandler<IMixedRealityBoundaryHandler>(this);
69+
CoreServices.BoundarySystem?.RegisterHandler<IMixedRealityBoundaryHandler>(this);
8470
}
8571

8672
private void OnDisable()
8773
{
88-
BoundarySystem?.UnregisterHandler<IMixedRealityBoundaryHandler>(this);
74+
CoreServices.BoundarySystem?.UnregisterHandler<IMixedRealityBoundaryHandler>(this);
8975
}
9076

9177
#endregion MonoBehaviour Implementation
@@ -112,24 +98,27 @@ private void AddMarkers()
11298
float widthRect;
11399
float heightRect;
114100

115-
if (BoundarySystem == null) { return; }
101+
if (CoreServices.BoundarySystem == null)
102+
{
103+
return;
104+
}
116105

117-
if (!BoundarySystem.TryGetRectangularBoundsParams(out centerRect, out angleRect, out widthRect, out heightRect))
106+
if (!CoreServices.BoundarySystem.TryGetRectangularBoundsParams(out centerRect, out angleRect, out widthRect, out heightRect))
118107
{
119108
// If we have no boundary manager or rectangular bounds we will show no indicators
120109
return;
121110
}
122111

123112
// Get the materials needed for marker display
124-
GameObject playArea = BoundarySystem.GetPlayAreaVisualization();
113+
GameObject playArea = CoreServices.BoundarySystem.GetPlayAreaVisualization();
125114
if (playArea == null)
126115
{
127116
// Failed to get the play area visualization;
128117
return;
129118
}
130119
Material playAreaMaterial = playArea.GetComponent<Renderer>().sharedMaterial;
131120

132-
GameObject trackedArea = BoundarySystem.GetTrackedAreaVisualization();
121+
GameObject trackedArea = CoreServices.BoundarySystem.GetTrackedAreaVisualization();
133122
if (trackedArea == null)
134123
{
135124
// Failed to get the tracked area visualization;
@@ -155,12 +144,12 @@ private void AddMarkers()
155144

156145
Material material = null;
157146
// Check inscribed rectangle first
158-
if (BoundarySystem.Contains(position, UnityBoundary.Type.PlayArea))
147+
if (CoreServices.BoundarySystem.Contains(position, BoundaryType.PlayArea))
159148
{
160149
material = playAreaMaterial;
161150
}
162151
// Then check geometry
163-
else if (BoundarySystem.Contains(position, UnityBoundary.Type.TrackedArea))
152+
else if (CoreServices.BoundarySystem.Contains(position, BoundaryType.TrackedArea))
164153
{
165154
material = trackedAreaMaterial;
166155
}

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/DemoBasicSetup/Scripts/ColorTap.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Microsoft.MixedReality.Toolkit.Examples.Demos.EyeTracking
88
{
9+
[AddComponentMenu("Scripts/MRTK/Examples/ColorTap")]
910
public class ColorTap : MonoBehaviour, IMixedRealityFocusHandler, IMixedRealityPointerHandler
1011
{
1112
[SerializeField]

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/DemoBasicSetup/Scripts/FollowEyeGazeGazeProvider.cs

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,19 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos.EyeTracking
1010
/// Sample for allowing the game object that this script is attached to follow the user's eye gaze
1111
/// at a given distance of "DefaultDistanceInMeters".
1212
/// </summary>
13+
[AddComponentMenu("Scripts/MRTK/Examples/FollowEyeGazeGazeProvider")]
1314
public class FollowEyeGazeGazeProvider : MonoBehaviour
1415
{
1516
[Tooltip("Display the game object along the eye gaze ray at a default distance (in meters).")]
1617
[SerializeField]
1718
private float defaultDistanceInMeters = 2f;
1819

19-
private IMixedRealityInputSystem inputSystem = null;
20-
21-
/// <summary>
22-
/// The active instance of the input system.
23-
/// </summary>
24-
private IMixedRealityInputSystem InputSystem
25-
{
26-
get
27-
{
28-
if (inputSystem == null)
29-
{
30-
MixedRealityServiceRegistry.TryGetService<IMixedRealityInputSystem>(out inputSystem);
31-
}
32-
return inputSystem;
33-
}
34-
}
35-
3620
private void Update()
3721
{
38-
if (InputSystem?.GazeProvider != null)
22+
var gazeProvider = CoreServices.InputSystem?.GazeProvider;
23+
if (gazeProvider != null)
3924
{
40-
gameObject.transform.position = InputSystem.GazeProvider.GazeOrigin + InputSystem.GazeProvider.GazeDirection.normalized * defaultDistanceInMeters;
25+
gameObject.transform.position = gazeProvider.GazeOrigin + gazeProvider.GazeDirection.normalized * defaultDistanceInMeters;
4126
}
4227
}
4328
}

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/DemoScrollPanZoom/Scripts/BaseClasses/PanZoomBase.cs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ protected IMixedRealityEyeSaccadeProvider EyeSaccadeProvider
131131
{
132132
if (eyeSaccadeProvider == null)
133133
{
134-
IMixedRealityEyeGazeDataProvider eyeGazeProvider = (InputSystem as IMixedRealityDataProviderAccess)?.GetDataProvider<IMixedRealityEyeGazeDataProvider>();
134+
IMixedRealityEyeGazeDataProvider eyeGazeProvider = (CoreServices.InputSystem as IMixedRealityDataProviderAccess)?.GetDataProvider<IMixedRealityEyeGazeDataProvider>();
135135
eyeSaccadeProvider = eyeGazeProvider?.SaccadeProvider;
136136
}
137137
return eyeSaccadeProvider;
@@ -140,23 +140,6 @@ protected IMixedRealityEyeSaccadeProvider EyeSaccadeProvider
140140

141141
#endregion
142142

143-
private IMixedRealityInputSystem inputSystem = null;
144-
145-
/// <summary>
146-
/// The active instance of the input system.
147-
/// </summary>
148-
protected IMixedRealityInputSystem InputSystem
149-
{
150-
get
151-
{
152-
if (inputSystem == null)
153-
{
154-
MixedRealityServiceRegistry.TryGetService<IMixedRealityInputSystem>(out inputSystem);
155-
}
156-
return inputSystem;
157-
}
158-
}
159-
160143
public abstract void Initialize();
161144
public abstract float ComputePanSpeed(float cursorPosInOneDir, float maxSpeed, float minDistFromCenterForAutoPan);
162145
public abstract int ZoomDir(bool zoomIn);
@@ -591,7 +574,7 @@ void IMixedRealitySourceStateHandler.OnSourceDetected(SourceStateEventData event
591574

592575
void IMixedRealitySourceStateHandler.OnSourceLost(SourceStateEventData eventData)
593576
{
594-
foreach (var pointer in InputSystem.GazeProvider.GazeInputSource.Pointers)
577+
foreach (var pointer in CoreServices.InputSystem.GazeProvider.GazeInputSource.Pointers)
595578
{
596579
pointer.IsFocusLocked = false;
597580
}

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/DemoScrollPanZoom/Scripts/BaseClasses/PanZoomBaseRectTransf.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos.EyeTracking
99
/// This script allows to zoom into and pan the texture of a GameObject.
1010
/// It also allows for scrolling by restricting panning to one direction.
1111
/// </summary>
12+
[AddComponentMenu("Scripts/MRTK/Examples/PanZoomBaseRectTransf")]
1213
public class PanZoomBaseRectTransf : PanZoomBase
1314
{
1415
internal RectTransform navRectTransf = null;
@@ -176,7 +177,7 @@ public override bool UpdateCursorPosInHitBox()
176177
Vector3 halfsize = gameObject.transform.lossyScale / 2;
177178

178179
// Let's transform back to the origin: Translate & Rotate
179-
Vector3 transfHitPnt = InputSystem.EyeGazeProvider.HitPosition - center;
180+
Vector3 transfHitPnt = CoreServices.InputSystem.EyeGazeProvider.HitPosition - center;
180181

181182
// Rotate around the y axis
182183
transfHitPnt = Quaternion.AngleAxis(-(gameObject.transform.rotation.eulerAngles.y - 180), Vector3.up) * transfHitPnt;

0 commit comments

Comments
 (0)