private void StoreLoaded(UnityEngine.XR.WSA.Persistence.WorldAnchorStore store)
    {
        this.store = store;

        // We've loaded.  Wait to place.
        StartCoroutine(PlaceWorldAnchor());
    }
예제 #2
0
    void AnchorStoreReady(UnityEngine.XR.WSA.Persistence.WorldAnchorStore store)
    {
        anchorStore = store;

        string[] ids = anchorStore.GetAllIds();

        foreach (GameObject marker in Markers)
        {
            // Retrieve WorldAnchors for each marker if it exists
            Debug.Log("Looking for " + marker.name + " in WorldAnchorStore");
            UnityEngine.XR.WSA.WorldAnchor wa = anchorStore.Load(marker.name, marker);
            if (wa != null)
            {
                Debug.Log("Retrieved anchor from WorldAnchorStore");
            }
            else
            {
                // Set new WorldAnchor if no existing WorldAnchor found
                Debug.Log("No WorldAnchor for " + marker.name + " found, creating new WorldAnchor");
                UnityEngine.XR.WSA.WorldAnchor attachingAnchor = marker.AddComponent <UnityEngine.XR.WSA.WorldAnchor>();
                if (attachingAnchor.isLocated)
                {
                    bool saved = anchorStore.Save(marker.name, attachingAnchor);
                    Debug.Log("Saved new WorldAnchor position for " + marker.name + ": " + saved);
                }
                else
                {
                    attachingAnchor.OnTrackingChanged += AttachingAnchor_OnTrackingChanged;
                }
            }
        }
    }
예제 #3
0
    void AnchorStoreReady(UnityEngine.XR.WSA.Persistence.WorldAnchorStore store)
    {
        anchorStore = store;

        //if (PlacementBypasser.Instance != null)
        //{
        //    CreateAnchor();
        //}
        CreateAnchor();
    }
예제 #4
0
 void AnchorStoreReady(UnityEngine.XR.WSA.Persistence.WorldAnchorStore store)
 {
     anchorStore = store;
     Debug.Log("looking for " + ObjectAnchorStoreName);
     anchorStore.Load(ObjectAnchorStoreName, gameObject);
     UnityEngine.XR.WSA.WorldAnchor anchor = gameObject.GetComponent <UnityEngine.XR.WSA.WorldAnchor>();
     if (anchor != null)
     {
         Destroy(anchor);
     }
 }
    private void AnchorStoreReady(UnityEngine.XR.WSA.Persistence.WorldAnchorStore store)
    {
        Debug.Log("WorldAnchorStore READY");
        anchorStore  = store;
        CurrentState = AnchorManagementState.AnchorStoreReady;

        if (!KeepRoomAlive)
        {
            anchorStore.Clear();
        }
    }
예제 #6
0
    void AnchorStoreReady(UnityEngine.XR.WSA.Persistence.WorldAnchorStore store)
    {
        anchorStore = store;
        Placing     = true;

        Debug.Log("looking for " + ObjectAnchorStoreName);
        string[] ids = anchorStore.GetAllIds();
        for (int index = 0; index < ids.Length; index++)
        {
            Debug.Log(ids[index]);
            if (ids[index] == ObjectAnchorStoreName)
            {
                UnityEngine.XR.WSA.WorldAnchor wa = anchorStore.Load(ids[index], gameObject);
                Placing = false;
                break;
            }
        }
    }
    /// <summary>
    /// Attempts to attach to  an anchor by anchorName in the local store..
    /// </summary>
    /// <returns>True if it attached, false if it could not attach</returns>
    private bool AttachToCachedAnchor(string AnchorName)
    {
        UnityEngine.XR.WSA.Persistence.WorldAnchorStore anchorStore = WorldAnchorManager.Instance.AnchorStore;
        Debug.Log("Looking for " + AnchorName);
        string[] ids = anchorStore.GetAllIds();
        for (int index = 0; index < ids.Length; index++)
        {
            if (ids[index] == AnchorName)
            {
                Debug.Log("Using what we have");
                anchorStore.Load(ids[index], objectToAnchor);
                AnchorEstablished = true;
                return(true);
            }
        }

        // Didn't find the anchor.
        return(false);
    }
예제 #8
0
 /// <summary>
 /// Called when the local anchor store is ready.
 /// </summary>
 /// <param name="store"></param>
 private void AnchorStoreReady(UnityEngine.XR.WSA.Persistence.WorldAnchorStore store)
 {
     anchorStore  = store;
     currentState = ImportExportState.AnchorStore_Initialized;
 }
예제 #9
0
 void AnchorStoreReady(UnityEngine.XR.WSA.Persistence.WorldAnchorStore store)
 {
     Debug.Log("Anchor Called");
     anchorStore = store;
 }
예제 #10
0
 private void StoreLoaded(UnityEngine.XR.WSA.Persistence.WorldAnchorStore store)
 {
     this.Store = store;
 }
예제 #11
0
 void GotStore(UnityEngine.XR.WSA.Persistence.WorldAnchorStore newStore)
 {
     Debug.Log("GOT STORE");
     store = newStore;
 }