Skip to content

Commit 3c0ac5a

Browse files
committed
Release v1.5.0
1 parent 55eebe6 commit 3c0ac5a

17 files changed

+182
-87
lines changed

Assets/MagicLeap/Examples/Scenes/Anchors.unity

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,7 @@ PrefabInstance:
748748
- target: {fileID: 9144045080993300993, guid: 6906f74934047d24e9a47bbdd1afb57a,
749749
type: 3}
750750
propertyPath: m_Text
751-
value: '<b>To create or localize to a map you must exit and use the Mapping
752-
Tool application first.</b>
751+
value: '<b>To create or localize to a map you must exit and use the Spaces application first.</b>
753752
754753
755754
This example demonstrates spatial anchors.

Assets/MagicLeap/Examples/Scenes/EyeTracking.unity

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RenderSettings:
3838
m_ReflectionIntensity: 1
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
41+
m_IndirectSpecularColor: {r: 0.18018606, g: 0.22559257, b: 0.30678663, a: 1}
4242
m_UseRadianceAmbientProbe: 0
4343
--- !u!157 &3
4444
LightmapSettings:
@@ -2333,6 +2333,11 @@ PrefabInstance:
23332333
propertyPath: stereoConvergencePoint
23342334
value:
23352335
objectReference: {fileID: 455349258}
2336+
- target: {fileID: 2062985119602007160, guid: fe799b2d0a84dfe43b001b56276fd2fb,
2337+
type: 3}
2338+
propertyPath: recenterXROriginAtStart
2339+
value: 0
2340+
objectReference: {fileID: 0}
23362341
- target: {fileID: 5589497133593145648, guid: fe799b2d0a84dfe43b001b56276fd2fb,
23372342
type: 3}
23382343
propertyPath: m_RootOrder

Assets/MagicLeap/Examples/Scenes/VoiceIntents.unity

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -856,17 +856,17 @@ PrefabInstance:
856856
- target: {fileID: 9144045079751414315, guid: 6906f74934047d24e9a47bbdd1afb57a,
857857
type: 3}
858858
propertyPath: m_AnchorMax.x
859-
value: 0
859+
value: 1
860860
objectReference: {fileID: 0}
861861
- target: {fileID: 9144045079751414315, guid: 6906f74934047d24e9a47bbdd1afb57a,
862862
type: 3}
863863
propertyPath: m_AnchorMax.y
864-
value: 0
864+
value: 0.99999976
865865
objectReference: {fileID: 0}
866866
- target: {fileID: 9144045079751414315, guid: 6906f74934047d24e9a47bbdd1afb57a,
867867
type: 3}
868868
propertyPath: m_AnchorMin.y
869-
value: 0
869+
value: 0.37016335
870870
objectReference: {fileID: 0}
871871
- target: {fileID: 9144045079804107918, guid: 6906f74934047d24e9a47bbdd1afb57a,
872872
type: 3}
@@ -1116,7 +1116,7 @@ PrefabInstance:
11161116
- target: {fileID: 9144045080803666704, guid: 6906f74934047d24e9a47bbdd1afb57a,
11171117
type: 3}
11181118
propertyPath: m_SizeDelta.y
1119-
value: 252
1119+
value: 18
11201120
objectReference: {fileID: 0}
11211121
- target: {fileID: 9144045080803666704, guid: 6906f74934047d24e9a47bbdd1afb57a,
11221122
type: 3}
@@ -1126,41 +1126,12 @@ PrefabInstance:
11261126
- target: {fileID: 9144045080803666704, guid: 6906f74934047d24e9a47bbdd1afb57a,
11271127
type: 3}
11281128
propertyPath: m_AnchoredPosition.y
1129-
value: -144
1129+
value: -27
11301130
objectReference: {fileID: 0}
11311131
- target: {fileID: 9144045080803666705, guid: 6906f74934047d24e9a47bbdd1afb57a,
11321132
type: 3}
11331133
propertyPath: m_Text
1134-
value: '<color=#B7B7B8><b>Speak the App Specific command out loud</b></color>
1135-
1136-
Use
1137-
one of the listed commands in the status panel to the right.
1138-
1139-
1140-
These
1141-
commands are application specific and are controlled in a list within the
1142-
Voice Intents Confguration Scriptable Object referenced in the example script.
1143-
1144-
1145-
A
1146-
list of the System Intents enabled from within the Applcation will be listed
1147-
in the status panel to the right as well. To use them, speak "Hey Magic Leap"
1148-
and dots to indicate the device is listening should appear. Then speak the
1149-
system command that has been enabled in the application.
1150-
1151-
1152-
System
1153-
intents are currently experimental as there are potentially issues if the
1154-
command causes a system popup and being able to accept or reject verbally
1155-
without the addition of a controller.
1156-
1157-
1158-
<color=#B7B7B8><b>Controller
1159-
Bumper</b></color>
1160-
1161-
By Default this example scene starts processing
1162-
Voice Intents. Tap the bumper to stop processing, then tap it again to begin
1163-
processing again.'
1134+
value: Filled in from Example Script
11641135
objectReference: {fileID: 0}
11651136
- target: {fileID: 9144045080852108117, guid: 6906f74934047d24e9a47bbdd1afb57a,
11661137
type: 3}
@@ -1251,7 +1222,7 @@ PrefabInstance:
12511222
- target: {fileID: 9144045081617561596, guid: 6906f74934047d24e9a47bbdd1afb57a,
12521223
type: 3}
12531224
propertyPath: m_SizeDelta.y
1254-
value: -66.41
1225+
value: -300.41
12551226
objectReference: {fileID: 0}
12561227
m_RemovedComponents: []
12571228
m_RemovedGameObjects: []
@@ -1276,6 +1247,18 @@ MonoBehaviour:
12761247
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
12771248
m_Name:
12781249
m_EditorClassIdentifier:
1250+
--- !u!114 &587049733 stripped
1251+
MonoBehaviour:
1252+
m_CorrespondingSourceObject: {fileID: 9144045080803666705, guid: 6906f74934047d24e9a47bbdd1afb57a,
1253+
type: 3}
1254+
m_PrefabInstance: {fileID: 587049730}
1255+
m_PrefabAsset: {fileID: 0}
1256+
m_GameObject: {fileID: 0}
1257+
m_Enabled: 1
1258+
m_EditorHideFlags: 0
1259+
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
1260+
m_Name:
1261+
m_EditorClassIdentifier:
12791262
--- !u!1 &1080811520
12801263
GameObject:
12811264
m_ObjectHideFlags: 0
@@ -2088,10 +2071,10 @@ MonoBehaviour:
20882071
m_Name:
20892072
m_EditorClassIdentifier:
20902073
_statusText: {fileID: 587049732}
2074+
controlsText: {fileID: 587049733}
20912075
voiceConfiguration: {fileID: 11400000, guid: fcc23b1971b6efa418c12c9ff7cf490b, type: 2}
20922076
voiceInputSettingsPopup: {fileID: 1080811520}
20932077
voiceInputErrorPopup: {fileID: 201242689}
2094-
errorDisplayTime: 5
20952078
--- !u!1 &1845271348
20962079
GameObject:
20972080
m_ObjectHideFlags: 0

Assets/MagicLeap/Examples/Scripts/ControlExample.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ void Start()
4545
controllerActions.Trigger.performed += HandleOnTrigger;
4646

4747
InputSubsystem.Extensions.Controller.AttachTriggerListener(HandleOnTriggerEvent);
48+
49+
_statusText.fontSize = 11;
4850
}
4951

5052
/// <summary>

Assets/MagicLeap/Examples/Scripts/MarkerTrackingExample.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ public class MarkerTrackingExample : MonoBehaviour
2929
[SerializeField]
3030
private MarkerVisual markerVisualPrefab;
3131

32-
[SerializeField]
33-
private GameObject markersRoot;
34-
3532
[SerializeField, Tooltip("Wait for a given amount of time before removing unobsereved trackers.")]
3633
private bool removeMarkersUsingTimeStamps = false;
3734

3835
[SerializeField, Tooltip("The timeout duration before removing unobserved trackers. Only used if removeMarkersUsingTimeStamps is set.")]
3936
private float markerTrackerTimeout = 0.5f;
4037

38+
private Transform xrOrigin;
39+
4140
/// <summary>
4241
/// The marker types that are enabled for this scanner. Enable markers by
4342
/// combining any number of <c> MarkerType </c> flags using '|' (bitwise 'or').
@@ -148,6 +147,7 @@ void Start()
148147
mlInputs = new MagicLeapInputs();
149148
mlInputs.Enable();
150149
controllerActions = new MagicLeapInputs.ControllerActions(mlInputs);
150+
xrOrigin = FindObjectOfType<Unity.XR.CoreUtils.XROrigin>().transform;
151151
EnableMarkerTrackerExample();
152152
}
153153

@@ -208,7 +208,7 @@ private void ProcessSingleMarker(MarkerData data)
208208
}
209209
else
210210
{
211-
MarkerVisual marker = Instantiate(markerVisualPrefab, markersRoot.transform);
211+
MarkerVisual marker = Instantiate(markerVisualPrefab, xrOrigin);
212212
markers.Add(new KeyValuePair<string, MarkerVisual>(id, marker));
213213
marker.Set(data);
214214
}
@@ -231,7 +231,7 @@ private void ProcessSingleMarker(MarkerData data)
231231
}
232232
else
233233
{
234-
MarkerVisual marker = Instantiate(markerVisualPrefab, markersRoot.transform);
234+
MarkerVisual marker = Instantiate(markerVisualPrefab, xrOrigin);
235235
markers.Add(new KeyValuePair<string, MarkerVisual>(id, marker));
236236
marker.Set(data, markerText);
237237
}

Assets/MagicLeap/Examples/Scripts/MeshingExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,4 @@ private void UpdateBounds()
322322
_meshingSubsystemComponent.gameObject.transform.localScale = _bounded ? _boundedExtentsSize : _boundlessExtentsSize;
323323
}
324324
}
325-
}
325+
}

Assets/MagicLeap/Examples/Scripts/Visualizers/AnchorVisualizer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ public class AnchorVisualizer : MonoBehaviour
99
public GameObject anchorPrefab;
1010
public MLAnchors.Request query;
1111
private Transform mainCamera;
12+
private Transform xrOrigin;
1213
private Dictionary<string, AnchorVisual> map = new Dictionary<string, AnchorVisual>();
1314

1415
void Start()
1516
{
1617
mainCamera = Camera.main.transform;
18+
xrOrigin = FindObjectOfType<Unity.XR.CoreUtils.XROrigin>().transform;
1719
query = new MLAnchors.Request();
1820
}
1921

@@ -32,7 +34,7 @@ void Update()
3234
string id = anchor.Id;
3335
if (map.ContainsKey(id) == false)
3436
{
35-
GameObject anchorGO = Instantiate(anchorPrefab);
37+
GameObject anchorGO = Instantiate(anchorPrefab, xrOrigin);
3638
map.Add(id, anchorGO.AddComponent<AnchorVisual>());
3739
}
3840
map[id].Set(anchor);

Assets/MagicLeap/Examples/Scripts/VoiceIntentsExample.cs

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections;
22
using System.Collections.Generic;
3+
using System.Linq;
34
using System.Text;
45
using UnityEngine;
56
using UnityEngine.InputSystem;
@@ -11,6 +12,9 @@ public class VoiceIntentsExample : MonoBehaviour
1112
[SerializeField, Tooltip("The text used to display status information for the example.")]
1213
private Text _statusText = null;
1314

15+
[SerializeField, Tooltip("The text used to display input controls for the example.")]
16+
private Text controlsText = null;
17+
1418
[SerializeField, Tooltip("The configuration file that holds the list of intents used for this application.")]
1519
private MLVoiceIntentsConfiguration voiceConfiguration;
1620

@@ -74,37 +78,10 @@ private void Initialize()
7478
{
7579
controllerActions.Bumper.performed += HandleOnBumper;
7680
isProcessing = true;
77-
startupStatus += "\n\n<color=#B7B7B8><b>List of Voice Intents:</b></color>";
7881

7982
MLVoice.OnVoiceEvent += VoiceEvent;
8083

81-
List<string> allValues = voiceConfiguration.GetValues();
82-
83-
foreach (string value in allValues)
84-
{
85-
startupStatus += "\n" + value;
86-
}
87-
88-
string systemValues = "\n<color=#B7B7B8><b>System Intents:</b></color>\n";
89-
90-
bool skipFirst = true;
91-
foreach (MLVoiceIntentsConfiguration.SystemIntentFlags flag in System.Enum.GetValues(typeof(MLVoiceIntentsConfiguration.SystemIntentFlags)))
92-
{
93-
if (voiceConfiguration.AutoAllowAllSystemIntents || voiceConfiguration.SystemCommands.HasFlag(flag))
94-
{
95-
if (!skipFirst)
96-
{
97-
systemValues += " , ";
98-
}
99-
else
100-
{
101-
skipFirst = false;
102-
}
103-
systemValues += flag.ToString();
104-
}
105-
}
106-
107-
startupStatus += systemValues;
84+
SetControlsText();
10885
}
10986
else
11087
{
@@ -147,9 +124,43 @@ private void UpdateStatus()
147124
{
148125
_statusText.text = $"<color=#B7B7B8><b>Voice Intents Data</b></color>\n{startupStatus}";
149126
_statusText.text += "\n\nIs Processing: " + isProcessing;
127+
_statusText.text += "\n\nInstructions and List of commands in Controls Tab";
150128
_statusText.text += lastResults;
151129
}
152130

131+
private void SetControlsText()
132+
{
133+
StringBuilder controlsScrollview = new StringBuilder();
134+
135+
controlsScrollview.Append($"<color=#B7B7B8><b>Speak the App Specific command out loud</b></color>\n");
136+
controlsScrollview.Append($"Use one of these listed commands: \n");
137+
138+
controlsScrollview.AppendJoin('\n', voiceConfiguration.GetValues());
139+
140+
controlsScrollview.Append($"\n\n<color=#B7B7B8><b>To Use a System Intent speak \"Hey Magic Leap\"</b></color>\nDots to indicate the device is listening should appear. Then speak one of the enabled system commands: \n");
141+
142+
foreach (MLVoiceIntentsConfiguration.SystemIntentFlags flag in System.Enum.GetValues(typeof(MLVoiceIntentsConfiguration.SystemIntentFlags)))
143+
{
144+
if (voiceConfiguration.AutoAllowAllSystemIntents || voiceConfiguration.SystemCommands.HasFlag(flag))
145+
{
146+
controlsScrollview.Append($"{flag.ToString()}\n");
147+
148+
}
149+
}
150+
151+
controlsScrollview.Append($"\n\n<color=#B7B7B8><b>Slots</b></color>\nA Slot is a placeholder for a list of possible values. The name of the slot is placed between brackets within the App Specific commands value and when uttering the phrase one of the slots values is used in its place.\n");
152+
controlsScrollview.Append($"Slots Values Used:");
153+
154+
foreach (MLVoiceIntentsConfiguration.SlotData slot in voiceConfiguration.SlotsForVoiceCommands)
155+
{
156+
controlsScrollview.Append($"\n{slot.name} : {string.Join(" - ", slot.values)}");
157+
}
158+
159+
controlsScrollview.Append($"\n\n<color=#B7B7B8><b>Controller Bumper</b></color>\nBy Default this example scene starts processing Voice Intents. Tap the bumper to stop processing, then tap it again to begin processing again.");
160+
161+
controlsText.text = controlsScrollview.ToString();
162+
}
163+
153164
void VoiceEvent(in bool wasSuccessful, in MLVoice.IntentEvent voiceEvent)
154165
{
155166
StringBuilder strBuilder = new StringBuilder();
@@ -160,6 +171,9 @@ void VoiceEvent(in bool wasSuccessful, in MLVoice.IntentEvent voiceEvent)
160171
strBuilder.Append($"Event Unique Name:\n<i>{voiceEvent.EventName}</i>\n");
161172
strBuilder.Append($"Event Unique Id: <i>{voiceEvent.EventID}</i>\n");
162173

174+
strBuilder.Append($"Slots Used:\n");
175+
strBuilder.AppendJoin("\n",voiceEvent.EventSlotsUsed.Select(v => $"Name: {v.SlotName} - Value: {v.SlotValue}"));
176+
163177
lastResults = strBuilder.ToString();
164178
}
165179

Assets/MagicLeap/Examples/Scripts/WebViewExample.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ private void CreateWebViewWindow()
232232
{
233233
Debug.LogError("Failed to create web view window");
234234
}
235+
else
236+
{
237+
tabBar.CreateTab();
238+
}
235239
}
236240

237241
/// <summary>

Assets/MagicLeap/Examples/VoiceIntentsExampleConfiguration.asset

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,18 @@ MonoBehaviour:
2020
Value: Trigger Event
2121
- Id: 103
2222
Value: Hello Friend | Hello Buddy
23+
- Id: 104
24+
Value: Slot Test for ({Shape}|{Color})
25+
AutoAllowAllSystemIntents: 0
2326
SystemCommands: 2008
27+
SlotsForVoiceCommands:
28+
- name: Shape
29+
values:
30+
- Square
31+
- Circle
32+
- Triangle
33+
- name: Color
34+
values:
35+
- Red
36+
- Green
37+
- Blue

0 commit comments

Comments
 (0)