Skip to content

Commit cb936a4

Browse files
anonymous2585Anonymousdavid-c-klinekeveleigh
authored
SeeItSayItLabel improvements (#593) (#792)
* Add SeeItSayItLabel automatic update when changing button's keyword, allow translation for the pattern (#593) * Fix tests compilation without speech package (#593) (#792) * Fix SeeItSayItLabelEnabler not unsubscribing on destroy (#593) (#792) * Fix tests for unsupported machine (#593) (#792) * Update org.mixedrealitytoolkit.uxcore/SeeItSayIt/SeeItSayItLabelEnabler.cs Co-authored-by: Kurtis <[email protected]> Signed-off-by: David Kline <[email protected]> * Update CHANGELOG.md * Formatting and typo updates * Remove space from scene name * Update SeeItSayItLabelEnabler.cs * Always fall back to pattern if localizedPattern is empty Even with the Localization package installed, some prefabs may need the fallback behavior (even if just temporarily) * Add custom editor --------- Signed-off-by: David Kline <[email protected]> Signed-off-by: Kurtis <[email protected]> Co-authored-by: Anonymous <[email protected]> Co-authored-by: David Kline <[email protected]> Co-authored-by: Kurtis <[email protected]> Co-authored-by: Kurtis <[email protected]>
1 parent 2af5033 commit cb936a4

File tree

16 files changed

+253
-33
lines changed

16 files changed

+253
-33
lines changed

UnityProjects/MRTKDevTemplate/Packages/packages-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@
431431
"source": "local",
432432
"dependencies": {
433433
"com.microsoft.mrtk.graphicstools.unity": "0.5.12",
434-
"org.mixedrealitytoolkit.core": "3.2.0",
434+
"org.mixedrealitytoolkit.core": "3.3.0",
435435
"com.unity.inputsystem": "1.6.1",
436436
"com.unity.textmeshpro": "3.0.6",
437437
"com.unity.xr.interaction.toolkit": "2.3.0"

UnityProjects/MRTKDevTemplate/ProjectSettings/EditorBuildSettings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ EditorBuildSettings:
117117
path: Assets/Scenes/Experimental/ScrollingExample.unity
118118
guid: 77e21ebc978cbc84f9ebe061742ae42d
119119
- enabled: 1
120-
path: Assets/Scenes/SeeItSayIt Example.unity
120+
path: Assets/Scenes/SeeItSayItExample.unity
121121
guid: cb7d2aaea1c5a4d469a6408ee9ddc5fc
122122
- enabled: 1
123123
path: Assets/Scenes/SlateDrawingExample.unity

org.mixedrealitytoolkit.core/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
88

99
* Updated tests to follow existing MRTK test patterns. [PR #1046](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1046)
1010

11+
### Added
12+
13+
* Added event `OnSpeechRecognitionKeywordChanged` to allow UI updates when the speech recognition keyword has changed. [PR #792](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/792/)
14+
1115
### Fixed
1216

1317
* Fixed broken project validation help link, for item 'MRTK3 profile may need to be assigned for the Standalone build target' (Issue #882) [PR #886](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/886)

org.mixedrealitytoolkit.core/Editor/Editors/StatefulInteractableEditor.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class StatefulInteractableEditor : BaseInteractableEditor
2323
private SerializedProperty allowSelectByVoice;
2424
private SerializedProperty SelectRequiresHover;
2525
private SerializedProperty speechRecognitionKeyword;
26+
private SerializedProperty OnSpeechRecognitionKeywordChanged;
2627
private SerializedProperty VoiceRequiresFocus;
2728
private SerializedProperty UseGazeDwell;
2829
private SerializedProperty GazeDwellTime;
@@ -34,6 +35,7 @@ public class StatefulInteractableEditor : BaseInteractableEditor
3435
private SerializedProperty OnEnabled;
3536
private SerializedProperty OnDisabled;
3637
private static bool advancedFoldout = false;
38+
private static bool speechRecognitionKeywordEventFoldout = false;
3739
private static bool enabledEventsFoldout = false;
3840

3941
/// <summary>
@@ -57,6 +59,7 @@ protected override void OnEnable()
5759

5860
allowSelectByVoice = SetUpProperty(nameof(allowSelectByVoice));
5961
speechRecognitionKeyword = SetUpProperty(nameof(speechRecognitionKeyword));
62+
OnSpeechRecognitionKeywordChanged = SetUpAutoProperty(nameof(OnSpeechRecognitionKeywordChanged));
6063
VoiceRequiresFocus = SetUpAutoProperty(nameof(VoiceRequiresFocus));
6164

6265
SelectRequiresHover = SetUpAutoProperty(nameof(SelectRequiresHover));
@@ -166,8 +169,13 @@ protected void DrawProperties(bool showToggleMode)
166169
{
167170
using (new EditorGUI.IndentLevelScope())
168171
{
169-
EditorGUILayout.PropertyField(speechRecognitionKeyword);
170172
EditorGUILayout.PropertyField(VoiceRequiresFocus);
173+
EditorGUILayout.PropertyField(speechRecognitionKeyword);
174+
speechRecognitionKeywordEventFoldout = EditorGUILayout.Foldout(speechRecognitionKeywordEventFoldout, EditorGUIUtility.TrTempContent("Speech Recognition Keyword event"), true);
175+
if (speechRecognitionKeywordEventFoldout)
176+
{
177+
EditorGUILayout.PropertyField(OnSpeechRecognitionKeywordChanged);
178+
}
171179
}
172180
}
173181

org.mixedrealitytoolkit.core/Interactables/StatefulInteractable.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,17 @@ public string SpeechRecognitionKeyword
148148
{
149149
interactionManager.RegisterInteractable(this as IXRInteractable);
150150
}
151+
OnSpeechRecognitionKeywordChanged.Invoke(speechRecognitionKeyword);
151152
}
152153
}
153154
}
154-
155+
156+
/// <summary>
157+
/// Fired when the <see cref="SpeechRecognitionKeyword"/> has changed.
158+
/// </summary>
159+
[field: SerializeField, Tooltip("Fired when the Speech Recognition Keyword has changed.")]
160+
public UnityEvent<string> OnSpeechRecognitionKeywordChanged { get; private set; } = new UnityEvent<string>();
161+
155162
/// <summary>
156163
/// Does the voice command require this to have focus?
157164
/// If true, then the voice command will only respond to voice commands while this Interactable has focus.

org.mixedrealitytoolkit.core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "org.mixedrealitytoolkit.core",
3-
"version": "3.2.3-development",
3+
"version": "3.3.0-development",
44
"description": "A limited collection of common interfaces and utilities that most MRTK packages share. Most implementations of these interfaces are contained in other packages in the MRTK ecosystem.",
55
"displayName": "MRTK Core Definitions",
66
"msftFeatureCategory": "MRTK3",

org.mixedrealitytoolkit.uxcore/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
44

55
## Unreleased
66

7+
### Added
8+
9+
* Added automatic update for the `See It Say It Label` when the `SpeechRecognitionKeyword` of a `StatefulInteractable` has changed. Added ability to change the pattern, from inspector or code. [PR #792](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/792)
10+
* When Unity Localization package is installed, a `LocalizedString` is used as pattern. [PR #792](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/792)
11+
712
### Changed
813

914
* StateVisualizer: Modified access modifiers of State, stateContainers and UpdateStateValue to protected internal to allow adding states through subclassing. [PR #926](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/926)

org.mixedrealitytoolkit.uxcore/Editor/Inspectors/SeeItSayIt.meta

Lines changed: 8 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)