Пример #1
0
 private void OnOpenAR(object sender, EventArgs e)
 {
     if (Calibrated)
     {
         if (UsingServerCalibration)
         {
             WorldAnchorLocal.GetComponent <RecalibrateUsingServer>().CreateSelectorItem();
         }
         else
         {
             WorldAnchorLocal.GetComponent <Recalibrate>().CreateSelectorItem();
         }
     }
     else
     {
         if (!UsingServerCalibration)
         {
             foreach (ARTrackedImage anchorCube in ARTrackedImageManager.trackables)
             {
                 CreateAnchor anchor = anchorCube.GetComponent <CreateAnchor>();
                 if (anchor != null)
                 {
                     anchor.CreateSelectorItem();
                 }
             }
         }
     }
 }
        IEnumerator checkForAnchorId(String map_name)
        {
            yield return(new WaitForSeconds(1f));

            string anchor_id = CreateAnchor.getCurrentAnchorId();

            Debug.Log("anchor_id  " + anchor_id);
            attempts++;

            if (attempts < attemptLimit)
            {
                if (anchor_id == "")
                {
                    mLoader.SetActive(false);
                    StartCoroutine(checkForAnchorId(map_name));
                    Debug.Log("Anchor Id is null!!");
                }
                else
                {
                    Debug.Log("Anchor Id exist.");
                    //StartCoroutine(uploadMapData(map_name, anchor_id));

                    ReadyToUploadMap(map_name, anchor_id);

                    attempts = 0;
                }
            }
            else
            {
                mLoader.SetActive(false);

                Debug.Log("************\tError in getting Anchor ID !!!!!!!! \t***************");
                NotificationManager.Instance.GenerateError("Error in getting Anchor ID. Try agin..");

                attempts = 0;
            }
        }