File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Assets/HoloToolkit/Input/Scripts/Interactions Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ public class TapToPlace : MonoBehaviour, IInputClickHandler
4141 [ Tooltip ( "Setting this to true will allow this behavior to control the DrawMesh property on the spatial mapping." ) ]
4242 public bool AllowMeshVisualizationControl = true ;
4343
44+ private bool initialMeshVisualizationSetting = false ;
45+
4446 private Interpolator interpolator ;
4547
4648 /// <summary>
@@ -58,6 +60,12 @@ protected virtual void Start()
5860 PlaceParentOnTap = ParentGameObjectToPlace != null ;
5961 }
6062
63+ if ( SpatialMappingManager . Instance != null && AllowMeshVisualizationControl )
64+ {
65+ initialMeshVisualizationSetting = SpatialMappingManager . Instance . DrawVisualMeshes ;
66+ }
67+
68+
6169 interpolator = EnsureInterpolator ( ) ;
6270
6371 if ( IsBeingPlaced )
@@ -177,9 +185,9 @@ private void RemoveWorldAnchor()
177185 /// </summary>
178186 private void ToggleSpatialMesh ( )
179187 {
180- if ( SpatialMappingManager . Instance != null )
188+ if ( SpatialMappingManager . Instance != null && initialMeshVisualizationSetting == false && AllowMeshVisualizationControl )
181189 {
182- SpatialMappingManager . Instance . DrawVisualMeshes = IsBeingPlaced && AllowMeshVisualizationControl ;
190+ SpatialMappingManager . Instance . DrawVisualMeshes = IsBeingPlaced ;
183191 }
184192 }
185193
You can’t perform that action at this time.
0 commit comments