Skip to content

Commit c13595f

Browse files
committed
Fixed the logic fault to assign the anchorName.
1 parent ab079b3 commit c13595f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Assets/HoloToolkit/Utilities/Scripts/WorldAnchorManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private void Anchor_OnTrackingChanged(WorldAnchor anchor, bool located)
178178
/// If no anchor name is provided, the name of the anchor will be the same as the GameObject.
179179
/// </summary>
180180
/// <param name="gameObjectToAnchor">The GameObject to attach the anchor to.</param>
181-
/// <param name="anchorName">Name of the anchor. If none provided a GUID is generated for you.</param>
181+
/// <param name="anchorName">Name of the anchor. If none provided, the name of the GameObject will be used.</param>
182182
/// <returns>The name of the newly attached anchor.</returns>
183183
public string AttachAnchor(GameObject gameObjectToAnchor, string anchorName = null)
184184
{
@@ -198,7 +198,7 @@ public string AttachAnchor(GameObject gameObjectToAnchor, string anchorName = nu
198198
Debug.LogWarning("[WorldAnchorManager] AttachAnchor called before anchor store is ready.");
199199
}
200200

201-
anchorName = string.IsNullOrEmpty(anchorName) ? anchorName : gameObjectToAnchor.name;
201+
anchorName = string.IsNullOrEmpty(anchorName) ? gameObjectToAnchor.name : anchorName;
202202

203203
LocalAnchorOperations.Enqueue(
204204
new AnchorAttachmentInfo

0 commit comments

Comments
 (0)