Skip to content

Commit 003f673

Browse files
authored
Merge pull request #422 from HodgsonSDAS/HTK-TapToPlace
TapToPlace.cs: updated access modifiers
2 parents f64145f + 69b6707 commit 003f673

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Assets/HoloToolkit/SpatialMapping/Scripts/TapToPlace.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4-
using System;
54
using HoloToolkit.Unity.InputModule;
65
using UnityEngine;
76

@@ -24,29 +23,31 @@ public class TapToPlace : MonoBehaviour, IInputClickHandler
2423
public string SavedAnchorFriendlyName = "SavedAnchorFriendlyName";
2524

2625
[Tooltip("Place parent on tap instead of current game object.")]
27-
public bool PlaceParentOnTap = false;
26+
public bool PlaceParentOnTap;
2827

2928
[Tooltip("Specify the parent game object to be moved on tap, if the immediate parent is not desired.")]
3029
public GameObject ParentGameObjectToPlace;
3130

3231
/// <summary>
3332
/// Keeps track of if the user is moving the object or not.
3433
/// Setting this to true will enable the user to move and place the object in the scene.
34+
/// Useful when you want to place an object immediately.
3535
/// </summary>
36+
[Tooltip("Setting this to true will enable the user to move and place the object in the scene without needing to tap on the object. Useful when you want to place an object immediately.")]
3637
public bool IsBeingPlaced;
3738

3839
/// <summary>
3940
/// Manages persisted anchors.
4041
/// </summary>
41-
private WorldAnchorManager anchorManager;
42+
protected WorldAnchorManager anchorManager;
4243

4344
/// <summary>
4445
/// Controls spatial mapping. In this script we access spatialMappingManager
4546
/// to control rendering and to access the physics layer mask.
4647
/// </summary>
47-
private SpatialMappingManager spatialMappingManager;
48+
protected SpatialMappingManager spatialMappingManager;
4849

49-
public virtual void Start()
50+
private virtual void Start()
5051
{
5152
// Make sure we have all the components in the scene we need.
5253
anchorManager = WorldAnchorManager.Instance;
@@ -63,7 +64,7 @@ public virtual void Start()
6364

6465
if (anchorManager != null && spatialMappingManager != null)
6566
{
66-
anchorManager.AttachAnchor(this.gameObject, SavedAnchorFriendlyName);
67+
anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName);
6768
}
6869
else
6970
{
@@ -82,7 +83,7 @@ public virtual void Start()
8283
}
8384
}
8485

85-
public virtual void Update()
86+
private virtual void Update()
8687
{
8788
// If the user is in placing mode,
8889
// update the placement to match the user's gaze.
@@ -122,7 +123,7 @@ public virtual void Update()
122123
}
123124
}
124125

125-
public virtual void OnInputClicked(InputEventData eventData)
126+
protected virtual void OnInputClicked(InputEventData eventData)
126127
{
127128
// On each tap gesture, toggle whether the user is in placing mode.
128129
IsBeingPlaced = !IsBeingPlaced;

0 commit comments

Comments
 (0)