public void RecycleSoundMarker(SoundMarker marker, bool removeFromSoundMarkerList, bool eraseHotspotData) { _unusedMarkers.Push(marker); if (removeFromSoundMarkerList) { MainController.soundMarkers.Remove(marker); } if (eraseHotspotData) { _poolingDelegate.getLayoutManager().EraseHotspot(marker.hotspot); } marker.markerDelegate = null; marker.NullifyHotspot(); marker.gameObject.SetActive(false); Anchor anchorToDestroy = marker.GetComponentInParent <Anchor>(); marker.transform.parent = _poolingDelegate.getPoolingTransform(); marker.transform.localPosition = Vector3.zero; if (anchorToDestroy != null && anchorToDestroy is Anchor) { Object.Destroy(anchorToDestroy.gameObject); } }