@@ -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