File tree Expand file tree Collapse file tree
Assets/Scripts/TrajectoryPlanner/Probes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,17 +209,21 @@ private void Start()
209209 /// </summary>
210210 public void Destroy ( )
211211 {
212- // Delete this gameObject
213- foreach ( ProbeUIManager puimanager in _probeUIManagers )
214- puimanager . Destroy ( ) ;
215212
216213 ProbeProperties . ReturnColor ( Color ) ;
217214
218215 ColliderManager . RemoveProbeColliderInstances ( _probeColliders ) ;
219216
220217 // Force disable Ephys Link
221- CommunicationManager . Instance . UnregisterManipulator ( ManipulatorBehaviorController . ManipulatorID ) ;
222- IsEphysLinkControlled = false ;
218+ if ( IsEphysLinkControlled )
219+ {
220+ CommunicationManager . Instance . UnregisterManipulator ( ManipulatorBehaviorController . ManipulatorID ) ;
221+ IsEphysLinkControlled = false ;
222+ }
223+
224+ // Delete this gameObject
225+ foreach ( ProbeUIManager puimanager in _probeUIManagers )
226+ puimanager . Destroy ( ) ;
223227 }
224228
225229 private void OnDestroy ( )
You can’t perform that action at this time.
0 commit comments