Beispiel #1
0
 private void onAnchorLoadedFromStore(bool successfull)
 {
     if (successfull)
     {
         Debug.Log("Device " + gameObject.name + " loaded anchor from store successfully");
         anchorOrigin = AnchorOrigin.Local;
         StartCoroutine(loadAnchorFromServerifNotLocated(20));
     }
 }
Beispiel #2
0
        private IEnumerator loadAnchorFromServerifNotLocated(int seconds)
        {
            yield return(new WaitForSeconds(seconds));

            var WA = GetComponent <WorldAnchor>();

            //if anchor not located within this time
            if (anchorOrigin == AnchorOrigin.Local && WA != null && !this.GetComponent <WorldAnchor>().isLocated)
            {
                Debug.Log("Device " + gameObject.name + " local anchor could not be located, now trying from server");
                anchorOrigin = AnchorOrigin.OverrideAnchorFromServer;//set to override
                StartCoroutine(startLoadAnchorFromServer(0));
            }
        }
Beispiel #3
0
        private void onImportCompleteForUnity(object transferBatchObject)
        {
            WorldAnchorTransferBatch transferBatch = (WorldAnchorTransferBatch)transferBatchObject;


            //before we lock this, we remove the world anchor
            detachWorldAnchor();

            //locks it in place
            WorldAnchor wa = transferBatch.LockObject(gameObject.name, this.gameObject);

            anchorOrigin = AnchorOrigin.Server;

            //saves the importet anchor in the store
            WorldAnchorManager.Instance.SaveAnchor(this.gameObject);


            //if import complete, we take the time from information as current time
            latestAnchor = importInformation.anchorTime;

            //reset
            importInformation = default(ImportInformation);
        }