Skip to content

Commit b80ff70

Browse files
committed
Properly cleanup controller gameobjects in OnDestroy
1 parent e59ff5a commit b80ff70

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Assets/HoloToolkit/Input/Scripts/Utilities/MotionControllerVisualizer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ protected override void OnDestroy()
108108
InteractionManager.InteractionSourceDetected -= InteractionManager_InteractionSourceDetected;
109109
InteractionManager.InteractionSourceLost -= InteractionManager_InteractionSourceLost;
110110
Application.onBeforeRender -= Application_onBeforeRender;
111+
112+
foreach (MotionControllerInfo controllerInfo in controllerDictionary.Values)
113+
{
114+
Destroy(controllerInfo.ControllerParent);
115+
}
111116
#endif
112117
}
113118

0 commit comments

Comments
 (0)