Skip to content

Commit 0e08f69

Browse files
authored
Merge branch 'feature/XRI3' into deprecate-IVariableSelectInteractor
Signed-off-by: Kurtis <3580640+keveleigh@users.noreply.github.com>
2 parents 71432a6 + 7392248 commit 0e08f69

52 files changed

Lines changed: 671 additions & 126 deletions

File tree

Some content is hidden

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

UnityProjects/MRTKDevTemplate/Assets/Scripts/SystemKeyboardExample.cs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Copyright (c) Mixed Reality Toolkit Contributors
22
// Licensed under the BSD 3-Clause
33

4-
// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples.
5-
#pragma warning disable CS1591
6-
7-
using MixedReality.Toolkit.Input;
84
using MixedReality.Toolkit.UX;
95
using TMPro;
106
using UnityEngine;
@@ -30,10 +26,8 @@ public class SystemKeyboardExample : MonoBehaviour
3026
[SerializeField]
3127
private TextMeshPro debugMessage = null;
3228

33-
#pragma warning disable 0414
3429
[SerializeField]
3530
private KeyboardPreview mixedRealityKeyboardPreview = null;
36-
#pragma warning restore 0414
3731

3832
/// <summary>
3933
/// Opens a platform specific keyboard.
@@ -43,15 +37,18 @@ public void OpenSystemKeyboard()
4337
#if WINDOWS_UWP
4438
wmrKeyboard.ShowKeyboard(wmrKeyboard.Text, false);
4539
#elif UNITY_IOS || UNITY_ANDROID
46-
touchscreenKeyboard = TouchScreenKeyboard.Open(string.Empty, TouchScreenKeyboardType.Default, false, false, false, false);
40+
if (TouchScreenKeyboard.isSupported)
41+
{
42+
touchscreenKeyboard = TouchScreenKeyboard.Open(string.Empty, TouchScreenKeyboardType.Default, false, false, false, false);
43+
}
4744
#endif
4845
}
4946

5047
#region MonoBehaviour Implementation
5148

5249
/// <summary>
5350
/// A Unity event function that is called on the frame when a script is enabled just before any of the update methods are called the first time.
54-
/// </summary>
51+
/// </summary>
5552
private void Start()
5653
{
5754
// Initially hide the preview.
@@ -91,7 +88,6 @@ private void Start()
9188
#endif
9289
}
9390

94-
9591
#if WINDOWS_UWP
9692
/// <summary>
9793
/// A Unity event function that is called every frame, if this object is enabled.
@@ -149,19 +145,19 @@ private void Update()
149145
// touch screen keyboard.
150146
if (touchscreenKeyboard != null)
151147
{
152-
string KeyboardText = touchscreenKeyboard.text;
148+
string keyboardText = touchscreenKeyboard.text;
153149
if (TouchScreenKeyboard.visible)
154150
{
155151
if (debugMessage != null)
156152
{
157-
debugMessage.text = "typing... " + KeyboardText;
153+
debugMessage.text = "typing... " + keyboardText;
158154
}
159155
}
160156
else
161157
{
162158
if (debugMessage != null)
163159
{
164-
debugMessage.text = "typed " + KeyboardText;
160+
debugMessage.text = "typed " + keyboardText;
165161
}
166162

167163
touchscreenKeyboard = null;
@@ -173,4 +169,3 @@ private void Update()
173169
#endregion MonoBehaviour Implementation
174170
}
175171
}
176-
#pragma warning restore CS1591

docs/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
addressable (2.8.8)
4+
addressable (2.9.0)
55
public_suffix (>= 2.0.2, < 8.0)
66
base64 (0.3.0)
77
bigdecimal (3.3.1)
@@ -66,7 +66,7 @@ GEM
6666
mercenary (0.4.0)
6767
pathutil (0.16.2)
6868
forwardable-extended (~> 2.6)
69-
public_suffix (7.0.0)
69+
public_suffix (7.0.5)
7070
rake (13.3.1)
7171
rb-fsevent (0.11.2)
7272
rb-inotify (0.11.1)

org.mixedrealitytoolkit.core/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
44

55
## Unreleased
66

7+
### Added
8+
9+
* Added new `editorDefault` field for debugging the various `DisplayType`s in-editor. [PR #1130](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1130)
10+
* Added edit mode tests for `AssemblyExtensions`, `SystemType`, and `SerializableDictionary`. [PR #1122](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1122)
11+
712
### Changed
813

14+
* Updated `PackageValidator` to only be valid if `UNITY_EDITOR` is true. [PR #1125](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1125)
15+
* `AssemblyExtensions.GetLoadableTypes` now throws `ArgumentNullException` when called on a null assembly instead of `NullReferenceException`. [PR #1122](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1122)
16+
* Updated `MRTKBaseInteractable` to follow MRTK style. [PR #1073](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1073)
917
* Updated `StatefulInteractable` to work across all `IXRInteractionStrengthInteractor` implementations, instead of just MRTK-specific `IVariableSelectInteractor` implementations. [PR #1085](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1085)
1018

1119
### Deprecated
@@ -25,7 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
2533

2634
### Fixed
2735

28-
* Fixed "The type MixedReality.Toolkit.Core MixedReality.Toolkit.Experimental.BubbleChildHoverEvents/TrickleChildHoverEvents/BubbleChildSelectEvents/TrickleChildSelectEvents is being serialized by `[SerializeReference]`, but is missing the `[Serializable]` attribute." on Unity 6.3. [PR #1107](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1107)
36+
* Fixed "The type `MixedReality.Toolkit.Core MixedReality.Toolkit.Experimental.BubbleChildHoverEvents/TrickleChildHoverEvents/BubbleChildSelectEvents/TrickleChildSelectEvents` is being serialized by `[SerializeReference]`, but is missing the `[Serializable]` attribute." on Unity 6.3. [PR #1107](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1107)
2937

3038
### Deprecated
3139

org.mixedrealitytoolkit.core/Camera/CameraSettingsManager.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ namespace MixedReality.Toolkit
1212
[AddComponentMenu("MRTK/Core/Camera Settings Manager")]
1313
public class CameraSettingsManager : MonoBehaviour
1414
{
15-
[SerializeField]
15+
[SerializeField, Tooltip("The default display type in the editor.")]
16+
private DisplayType editorDefault = DisplayType.Transparent;
17+
18+
[SerializeField, Tooltip("The settings to apply when the display is opaque (VR).")]
1619
private CameraSettings opaqueDisplay = new CameraSettings(DisplayType.Opaque);
1720

1821
/// <summary>
@@ -24,7 +27,7 @@ public CameraSettings OpaqueDisplay
2427
set => opaqueDisplay = value;
2528
}
2629

27-
[SerializeField]
30+
[SerializeField, Tooltip("The settings to apply when the display is transparent (AR).")]
2831
private CameraSettings transparentDisplay = new CameraSettings(DisplayType.Transparent);
2932

3033
/// <summary>
@@ -81,7 +84,7 @@ private void UpdateCameraSettings(DisplayType type)
8184
{
8285
using (UpdateCameraSettingsPerfMarker.Auto())
8386
{
84-
UnityEngine.Camera mainCamera = Camera.main;
87+
Camera mainCamera = Camera.main;
8588

8689
switch (type)
8790
{
@@ -133,7 +136,7 @@ private DisplayType GetDisplayType()
133136
{
134137
using (GetDisplayTypePerfMarker.Auto())
135138
{
136-
if (XRSubsystemHelpers.DisplaySubsystem == null) { return DisplayType.Unknown; }
139+
if (XRSubsystemHelpers.DisplaySubsystem == null) { return Application.isEditor ? editorDefault : DisplayType.Unknown; }
137140
return XRSubsystemHelpers.DisplaySubsystem.displayOpaque ? DisplayType.Opaque : DisplayType.Transparent;
138141
}
139142
}

org.mixedrealitytoolkit.core/Interactables/MRTKBaseInteractable.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
1919
{
2020
#region Gaze
2121

22-
readonly List<IGazeInteractor> hoveringGazeInteractors = new List<IGazeInteractor>();
22+
private readonly List<IGazeInteractor> hoveringGazeInteractors = new List<IGazeInteractor>();
2323

2424
/// <summary>
2525
/// (Read Only) The list of <see cref="IGazeInteractor"/> components currently gazing this object.
@@ -30,14 +30,14 @@ public class MRTKBaseInteractable : XRBaseInteractable
3030

3131
#region GazePinch
3232

33-
readonly List<IGazePinchInteractor> hoveringGazePinchInteractors = new List<IGazePinchInteractor>();
33+
private readonly List<IGazePinchInteractor> hoveringGazePinchInteractors = new List<IGazePinchInteractor>();
3434

3535
/// <summary>
3636
/// (Read Only) The list of <see cref="IGazePinchInteractor"/> components currently hovering this object.
3737
/// </summary>
3838
public List<IGazePinchInteractor> HoveringGazePinchInteractors => hoveringGazePinchInteractors;
3939

40-
readonly List<IGazePinchInteractor> selectingGazePinchInteractors = new List<IGazePinchInteractor>();
40+
private readonly List<IGazePinchInteractor> selectingGazePinchInteractors = new List<IGazePinchInteractor>();
4141

4242
/// <summary>
4343
/// (Read Only) The list of <see cref="IGazePinchInteractor"/> components currently selecting this object.
@@ -48,7 +48,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
4848

4949
#region Poke
5050

51-
readonly List<IPokeInteractor> hoveringPokeInteractors = new List<IPokeInteractor>();
51+
private readonly List<IPokeInteractor> hoveringPokeInteractors = new List<IPokeInteractor>();
5252

5353
/// <summary>
5454
/// (Read Only) The list of <see cref="IPokeInteractor"/> components currently hovering this object.
@@ -59,14 +59,14 @@ public class MRTKBaseInteractable : XRBaseInteractable
5959

6060
#region Grab
6161

62-
readonly List<IGrabInteractor> hoveringGrabInteractors = new List<IGrabInteractor>();
62+
private readonly List<IGrabInteractor> hoveringGrabInteractors = new List<IGrabInteractor>();
6363

6464
/// <summary>
6565
/// (Read Only) The list of <see cref="IGrabInteractor"/> components currently hovering this object.
6666
/// </summary>]
6767
public List<IGrabInteractor> HoveringGrabInteractors => hoveringGrabInteractors;
6868

69-
readonly List<IGrabInteractor> selectingGrabInteractors = new List<IGrabInteractor>();
69+
private readonly List<IGrabInteractor> selectingGrabInteractors = new List<IGrabInteractor>();
7070

7171
/// <summary>
7272
/// (Read Only) The list of <see cref="IGrabInteractor"/> components currently selecting this object.
@@ -77,7 +77,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
7777

7878
#region Ray
7979

80-
readonly List<IRayInteractor> hoveringRayInteractors = new List<IRayInteractor>();
80+
private readonly List<IRayInteractor> hoveringRayInteractors = new List<IRayInteractor>();
8181

8282
/// <summary>
8383
/// (Read Only) The list of <see cref="IRayInteractor"/> components currently hovering this object.
@@ -95,7 +95,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
9595
/// <summary>
9696
/// Is this object selected by a gaze-pinch interactor?
9797
/// </summary>
98-
public TimedFlag IsGazePinchSelected { get => isGazePinchSelected; }
98+
public TimedFlag IsGazePinchSelected => isGazePinchSelected;
9999

100100
[SerializeField]
101101
[Tooltip("Is this object selected by a non-gaze ray interactor?")]
@@ -104,7 +104,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
104104
/// <summary>
105105
/// Is this object selected by a non-gaze ray interactor?
106106
/// </summary>
107-
public TimedFlag IsRaySelected { get => isRaySelected; }
107+
public TimedFlag IsRaySelected => isRaySelected;
108108

109109
[SerializeField]
110110
[Tooltip("Is this object selected by a poke interactor?")]
@@ -113,7 +113,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
113113
/// <summary>
114114
/// Is this object selected by a poke interactor?
115115
/// </summary>
116-
public TimedFlag IsPokeSelected { get => isPokeSelected; }
116+
public TimedFlag IsPokeSelected => isPokeSelected;
117117

118118
[SerializeField]
119119
[Tooltip("Is this object selected by a grab interactor?")]
@@ -122,7 +122,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
122122
/// <summary>
123123
/// Is this object selected by a grab interactor?
124124
/// </summary>
125-
public TimedFlag IsGrabSelected { get => isGrabSelected; }
125+
public TimedFlag IsGrabSelected => isGrabSelected;
126126

127127
[SerializeField]
128128
[Tooltip("Is this object hovered by any gaze interactor?")]
@@ -131,7 +131,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
131131
/// <summary>
132132
/// Is this object hovered by any gaze interactor?
133133
/// </summary>
134-
public TimedFlag IsGazeHovered { get => isGazeHovered; }
134+
public TimedFlag IsGazeHovered => isGazeHovered;
135135

136136
[SerializeField]
137137
[Tooltip("Is this object hovered by a gaze-pinch interactor?")]
@@ -140,7 +140,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
140140
/// <summary>
141141
/// Is this object hovered by a gaze-pinch interactor?
142142
/// </summary>
143-
public TimedFlag IsGazePinchHovered { get => isGazePinchHovered; }
143+
public TimedFlag IsGazePinchHovered => isGazePinchHovered;
144144

145145
[SerializeField]
146146
[Tooltip("Is this object hovered by a non-gaze ray interactor?")]
@@ -149,7 +149,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
149149
/// <summary>
150150
/// Is this object hovered by a non-gaze ray interactor?
151151
/// </summary>
152-
public TimedFlag IsRayHovered { get => isRayHovered; }
152+
public TimedFlag IsRayHovered => isRayHovered;
153153

154154
[SerializeField]
155155
[Tooltip("Is this object hovered by a grab interactor?")]
@@ -158,7 +158,7 @@ public class MRTKBaseInteractable : XRBaseInteractable
158158
/// <summary>
159159
/// Is this object hovered by a grab interactor?
160160
/// </summary>
161-
public TimedFlag IsGrabHovered { get => isGrabHovered; }
161+
public TimedFlag IsGrabHovered => isGrabHovered;
162162

163163
[SerializeField]
164164
[Tooltip("Is this object hovered by a near touch/poke interactor?")]
@@ -168,12 +168,12 @@ public class MRTKBaseInteractable : XRBaseInteractable
168168
/// <summary>
169169
/// Is this object hovered by a near touch/poke interactor?
170170
/// </summary>
171-
public TimedFlag IsPokeHovered { get => isPokeHovered; }
171+
public TimedFlag IsPokeHovered => isPokeHovered;
172172

173173
/// <summary>
174174
/// Is this object hovered by any interactor other than passive targeting interactors?
175175
/// </summary>
176-
public TimedFlag IsActiveHovered { get => isActiveHovered; }
176+
public TimedFlag IsActiveHovered => isActiveHovered;
177177

178178
[SerializeField]
179179
[Tooltip("Is this object hovered by any interactor other than only passive targeting interactors?")]
@@ -201,7 +201,7 @@ public void DisableInteractorType(SystemInterfaceType type)
201201
}
202202
}
203203
/// <summary>
204-
/// Removes the specified type to the set of interactors which cannot select this interactable
204+
/// Removes the specified type from the set of interactors which cannot select this interactable
205205
/// </summary>
206206
public void EnableInteractorType(SystemInterfaceType type)
207207
{
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright (c) Mixed Reality Toolkit Contributors
2+
// Licensed under the BSD 3-Clause
3+
4+
using NUnit.Framework;
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Linq;
8+
using System.Reflection;
9+
10+
namespace MixedReality.Toolkit.Core.Tests.EditMode
11+
{
12+
/// <summary>
13+
/// Unit tests for AssemblyExtensions.
14+
/// These run outside of PlayMode and do not require Unity engine initialization.
15+
/// </summary>
16+
public class AssemblyExtensionsTests
17+
{
18+
[Test]
19+
public void GetLoadableTypes_ReturnsTypes_ForValidAssembly()
20+
{
21+
Assembly currentAssembly = Assembly.GetExecutingAssembly();
22+
23+
IEnumerable<Type> types = currentAssembly.GetLoadableTypes();
24+
25+
Assert.IsNotNull(types, "GetLoadableTypes should never return null.");
26+
Assert.Greater(types.Count(), 0, "GetLoadableTypes should return the types within the executing assembly.");
27+
Assert.IsTrue(types.Contains(typeof(AssemblyExtensionsTests)), "GetLoadableTypes failed to return known loadable types.");
28+
}
29+
30+
[Test]
31+
public void GetLoadableTypes_HandlesNullAssembly_Safely()
32+
{
33+
Assembly nullAssembly = null;
34+
Assert.Throws<ArgumentNullException>(() => nullAssembly.GetLoadableTypes());
35+
}
36+
}
37+
}

org.mixedrealitytoolkit.core/Tests/Editor/AssemblyExtensionsTests.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.

0 commit comments

Comments
 (0)