Skip to content

Commit 0f475b8

Browse files
authored
Addressing remaining feedback on #9364 (#9371)
* fixed naming with controllers and eye gaze examples * Addressing remaining feedback on the pointer naming PR * addressing last traces of feedback
1 parent 4d74254 commit 0f475b8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Assets/MRTK/SDK/Features/UX/Scripts/Pointers/BaseControllerPointer.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ protected override async void Start()
168168

169169
await EnsureInputSystemValid();
170170

171-
// Setting the pointerName
172-
PointerName = $"{Handedness}_{gameObject.name}";
173-
174171
// We've been destroyed during the await.
175172
if (this == null)
176173
{
@@ -230,6 +227,12 @@ public override IMixedRealityController Controller
230227

231228
if (base.Controller != null && this != null)
232229
{
230+
// Ensures that the basePointerName is only initialized once
231+
if(basePointerName == string.Empty)
232+
{
233+
basePointerName = gameObject.name;
234+
}
235+
PointerName = $"{Handedness}_{basePointerName}";
233236
InputSourceParent = base.Controller.InputSource;
234237
SetCursor();
235238
}
@@ -252,6 +255,7 @@ public uint PointerId
252255
}
253256
}
254257

258+
private string basePointerName = string.Empty;
255259
private string pointerName = string.Empty;
256260

257261
/// <inheritdoc />

0 commit comments

Comments
 (0)