Skip to content

Commit 310a69c

Browse files
updated base controller model fetching.
Reverted nessicary property name change.
1 parent cff036f commit 310a69c

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

Assets/MixedRealityToolkit-SDK/Features/Input/Handlers/ControllerPoseSynchronizer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public class ControllerPoseSynchronizer : InputSystemGlobalListener, IMixedReali
2727

2828
[SerializeField]
2929
[Tooltip("Should this GameObject clean itself up when it's controller is lost?")]
30-
private bool destroyOnLost = true;
30+
private bool destroyOnSourceLost = true;
3131

3232
/// <inheritdoc />
3333
public bool DestroyOnLost
3434
{
35-
get { return destroyOnLost; }
36-
set { destroyOnLost = value; }
35+
get { return destroyOnSourceLost; }
36+
set { destroyOnSourceLost = value; }
3737
}
3838

3939
/// <summary>
@@ -104,7 +104,7 @@ public virtual void OnSourceLost(SourceStateEventData eventData)
104104
IsTracked = false;
105105
TrackingState = TrackingState.NotTracked;
106106

107-
if (destroyOnLost)
107+
if (destroyOnSourceLost)
108108
{
109109
if (Application.isEditor)
110110
{

Assets/MixedRealityToolkit/_Core/Devices/BaseController.cs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -157,26 +157,25 @@ private void TryRenderControllerModel(Type controllerType)
157157
{
158158
GameObject controllerModel = null;
159159

160-
// Get the global controller model for each hand.
161-
if (ControllerHandedness == Handedness.Left && MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GlobalLeftHandModel != null)
162-
{
163-
controllerModel = MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GlobalLeftHandModel;
164-
}
165-
else if (ControllerHandedness == Handedness.Right && MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GlobalRightHandModel != null)
166-
{
167-
controllerModel = MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GlobalRightHandModel;
168-
}
160+
if (!MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.RenderMotionControllers) { return; }
169161

170162
// If a specific controller template wants to override the global model, assign that instead.
171163
if (MixedRealityManager.Instance.ActiveProfile.IsControllerMappingEnabled &&
172-
MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.RenderMotionControllers &&
173-
!MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.UseDefaultModels)
164+
!MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.UseDefaultModels)
174165
{
175-
var controllerModelType = MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GetControllerModelOverride(controllerType, ControllerHandedness);
166+
controllerModel = MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GetControllerModelOverride(controllerType, ControllerHandedness);
167+
}
176168

177-
if (controllerModelType != null)
169+
// Get the global controller model for each hand.
170+
if (controllerModel == null)
171+
{
172+
if (ControllerHandedness == Handedness.Left && MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GlobalLeftHandModel != null)
173+
{
174+
controllerModel = MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GlobalLeftHandModel;
175+
}
176+
else if (ControllerHandedness == Handedness.Right && MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GlobalRightHandModel != null)
178177
{
179-
controllerModel = controllerModelType;
178+
controllerModel = MixedRealityManager.Instance.ActiveProfile.ControllerMappingProfile.GlobalRightHandModel;
180179
}
181180
}
182181

0 commit comments

Comments
 (0)