Skip to content

Commit d949e7a

Browse files
author
David Kline (ANALOG)
committed
add cursor prefab to gaze provider. is set by the input system
1 parent 632fc33 commit d949e7a

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

Assets/MixedRealityToolkit.Services/InputSystem/GazeProvider.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ public IMixedRealityInputSource GazeInputSource
104104
public IMixedRealityPointer GazePointer => gazePointer ?? InitializeGazePointer();
105105
private InternalGazePointer gazePointer = null;
106106

107+
/// <inheritdoc />
108+
public GameObject GazeCursorPrefab { get; set; }
109+
107110
/// <inheritdoc />
108111
public IMixedRealityCursor GazeCursor => GazePointer.BaseCursor;
109112

@@ -409,7 +412,7 @@ private IMixedRealityPointer InitializeGazePointer()
409412
MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.PointerProfile != null &&
410413
MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.PointerProfile.GazeCursorPrefab != null)
411414
{
412-
var cursor = Instantiate(MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.PointerProfile.GazeCursorPrefab, MixedRealityToolkit.Instance.MixedRealityPlayspace);
415+
var cursor = Instantiate(GazeCursorPrefab, MixedRealityToolkit.Instance.MixedRealityPlayspace);
413416
SetGazeCursor(cursor);
414417
}
415418

Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputSystem.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public override void Initialize()
154154
if (profile.PointerProfile.GazeProviderType?.Type != null)
155155
{
156156
GazeProvider = CameraCache.Main.gameObject.EnsureComponent(profile.PointerProfile.GazeProviderType.Type) as IMixedRealityGazeProvider;
157+
GazeProvider.GazeCursorPrefab = profile.PointerProfile.GazeCursorPrefab;
157158
}
158159
else
159160
{

Assets/MixedRealityToolkit/Interfaces/InputSystem/IMixedRealityGazeProvider.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ public interface IMixedRealityGazeProvider
2525
/// </summary>
2626
IMixedRealityPointer GazePointer { get; }
2727

28+
/// <summary>
29+
///
30+
/// </summary>
31+
GameObject GazeCursorPrefab { get; set; }
32+
2833
/// <summary>
2934
/// The Gaze Cursor for the provider.
3035
/// </summary>

0 commit comments

Comments
 (0)