MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

TapToPlace script Small Issue

Open HaraldHeide opened this issue 9 years ago • 6 comments

Have a feeling that we should check if the anchorManager.AnchorStore exists and are ready before Attach or Remove Anchors in the OnInputClicked handler. Something like: if (anchorManager.AnchorStore != null) { // Add world anchor when object placement is done. anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName); }

HaraldHeide avatar Apr 21 '17 17:04 HaraldHeide

This check is already happening in the start method

jessemcculloch avatar Apr 30 '17 00:04 jessemcculloch

@jessemcculloch, your last PR fixed this issue, correct?

StephenHodgson avatar Apr 30 '17 13:04 StephenHodgson

I didn't explicitly make a change to fix this. There is a check in the start method to verify that the anchor store exists, however I suppose it could get removed at some point between start running and when the placement tries to create an anchor.

jessemcculloch avatar Apr 30 '17 13:04 jessemcculloch

Looking through the WorldAnchorManager, it looks like it doesn't matter if the AnchorStore is null when we call AttachAnchor, because we're using a queue that will wait until the AnchorStore is initialized before attempting to add the anchor.

StephenHodgson avatar May 31 '17 21:05 StephenHodgson

So in theory we can close my PR, it's not necessary?

jessemcculloch avatar May 31 '17 21:05 jessemcculloch

Closed my PR, I think this issue can be closed as well

jessemcculloch avatar May 31 '17 21:05 jessemcculloch