Hello guys,
i’m currently working with the Mixed Reality Toolkit and the HoloLens and apparently the Toolkit uses the WorldAnchorStore class from UnityEngine.XR.WSA.Persistence.
My problem is that in the script WorldAnchorManager.cs (https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/master/Assets/HoloToolkit/Common/Scripts/WorldAnchorManager.cs) I don’t get an instance of the (singleton) WorldAnchorStore.
If I understand it correctly, in this line we just create an empty object that we will use as AnchorStore later on, but we need to get the “real” instance of the anchor store and assign it to (empty) AnchorStore.
public WorldAnchorStore AnchorStore { get; protected set; }
Here we use the method GetAsyn to get the instance and as parameter we have another method.
protected virtual void Start()
{
WorldAnchorStore.GetAsync(AnchorStoreReady);
}
This is the method we use as parameter:
protected virtual void AnchorStoreReady(WorldAnchorStore anchorStore)
{
AnchorStore = anchorStore;
if (!PersistentAnchors)
{
AnchorStore.Clear();
}
}
Now through using some Debug.Log messages I found out that AnchorStore is still null and I don’t really get why?
I am using the Unity 2017.4.2f2 editor (which contains the class WorldAnchorStore).
Another little piece of code I don’t understand is this here:
#if !UNITY_WSA || UNITY_EDITOR
Debug.LogWarning("World Anchor Manager does not work for this build. AttachAnchor will not be called.");
return null;
#else
Why shouldn’t the WorldAnchorManager work for this build if we have UNITY_EDITOR defined?
I hope I described the problem precisely and thanks in advance! ![]()