Пример #1
0
		public void RemoveAnchor(ARPlaneAnchor arPlaneAnchor)
		{
			if (planeAnchorMap.ContainsKey (arPlaneAnchor.identifier)) {
				ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
				GameObject.Destroy (arpag.gameObject);
				planeAnchorMap.Remove (arPlaneAnchor.identifier);
			}
		}
Пример #2
0
		public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor)
		{
			if (planeAnchorMap.ContainsKey (arPlaneAnchor.identifier)) {
				ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
				PlacenotePlaneUtility.UpdatePlaneWithAnchorTransform (arpag.gameObject, arPlaneAnchor);
				arpag.planeAnchor = arPlaneAnchor;
				planeAnchorMap [arPlaneAnchor.identifier] = arpag;
			}
		}
Пример #3
0
		public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
		{
			GameObject go = PlacenotePlaneUtility.CreatePlaneInScene (arPlaneAnchor);
			go.AddComponent<DontDestroyOnLoad> ();  //this is so these GOs persist across scene loads
			ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject ();
			arpag.planeAnchor = arPlaneAnchor;
			arpag.gameObject = go;
			planeAnchorMap.Add (arPlaneAnchor.identifier, arpag);
		}
Пример #4
0
 public void RemoveAnchor(ARPlaneAnchor arPlaneAnchor)
 {
     if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
     {
         ARPlaneAnchorGameObject aRPlaneAnchorGameObject = planeAnchorMap[arPlaneAnchor.identifier];
         UnityEngine.Object.Destroy(aRPlaneAnchorGameObject.gameObject);
         planeAnchorMap.Remove(arPlaneAnchor.identifier);
     }
 }
Пример #5
0
 public Transform GetGroundPlane(string groundPlaneIdentifier)
 {
     if (planeAnchorMap.ContainsKey(groundPlaneIdentifier))
     {
         ARPlaneAnchorGameObject arpag = planeAnchorMap[groundPlaneIdentifier];
         return(arpag.gameObject.transform);
     }
     return(null);
 }
Пример #6
0
 public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor)
 {
     if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
     {
         ARPlaneAnchorGameObject aRPlaneAnchorGameObject = planeAnchorMap[arPlaneAnchor.identifier];
         UnityARUtility.UpdatePlaneWithAnchorTransform(aRPlaneAnchorGameObject.gameObject, arPlaneAnchor);
         aRPlaneAnchorGameObject.planeAnchor      = arPlaneAnchor;
         planeAnchorMap[arPlaneAnchor.identifier] = aRPlaneAnchorGameObject;
     }
 }
Пример #7
0
        public void RemoveAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            Debug.Log("Remove anchor in manager");

            if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
            {
                ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
                GameObject.Destroy(arpag.gameObject);
                planeAnchorMap.Remove(arPlaneAnchor.identifier);
            }
        }
Пример #8
0
 public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor)
 {
     if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
     {
         ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
         UnityARUtility.UpdatePlaneWithAnchorTransform(arpag.gameObject, arPlaneAnchor);
         arpag.planeAnchor = arPlaneAnchor;
         planeAnchorMap [arPlaneAnchor.identifier] = arpag;
         bound = arpag.gameObject.GetComponentInChildren <MeshRenderer>().bounds;
     }
 }
Пример #9
0
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject gameObject = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            gameObject.AddComponent <DontDestroyOnLoad>();
            ARPlaneAnchorGameObject aRPlaneAnchorGameObject = new ARPlaneAnchorGameObject();

            aRPlaneAnchorGameObject.planeAnchor = arPlaneAnchor;
            aRPlaneAnchorGameObject.gameObject  = gameObject;
            planeAnchorMap.Add(arPlaneAnchor.identifier, aRPlaneAnchorGameObject);
        }
Пример #10
0
        public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            Debug.Log("Update anchor in manager");

            if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
            {
                ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
                UnityARUtility.UpdatePlaneWithAnchorTransform(arpag.gameObject, arPlaneAnchor);
                arpag.planeAnchor = arPlaneAnchor;
                planeAnchorMap [arPlaneAnchor.identifier] = arpag;
            }
        }
Пример #11
0
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject go = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            go.AddComponent <DontDestroyOnLoad> ();             //this is so these GOs persist across scene loads
            ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();

            arpag.planeAnchor = arPlaneAnchor;
            arpag.gameObject  = go;
            planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);

            // hide or show the newly created plane
            ToggleVisibility(mapBorderVisible);
        }
        public void RemoveAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
            {
                ARPlaneAnchorGameObject arpag      = planeAnchorMap[arPlaneAnchor.identifier];
                DebugPlaneTiler         planeTiler = arpag.gameObject.GetComponentInChildren <DebugPlaneTiler>();
                if (planeTiler)
                {
                    planeTiler.RemoveFromList();
                }

                GameObject.Destroy(arpag.gameObject);
                planeAnchorMap.Remove(arPlaneAnchor.identifier);
            }
        }
        public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
            {
                ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
                UnityARUtility.UpdatePlaneWithAnchorTransform(arpag.gameObject, arPlaneAnchor);
                arpag.planeAnchor = arPlaneAnchor;
                planeAnchorMap [arPlaneAnchor.identifier] = arpag;

                DebugPlaneTiler planeTiler = arpag.gameObject.GetComponentInChildren <DebugPlaneTiler>();
                if (planeTiler)
                {
                    planeTiler.UpdateWithinList();
                }
            }
        }
Пример #14
0
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject go = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            go.AddComponent <DontDestroyOnLoad> ();             //this is so these GOs persist across scene loads
            ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();

            arpag.planeAnchor = arPlaneAnchor;
            arpag.gameObject  = go;
            planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);
            //下面是自己写的
            //if(planeAnchorMap.Count>1){
            //    RemoveAnchor(lastARPlaneAnchor);
            //}
            bound             = go.GetComponentInChildren <MeshRenderer>().bounds;
            lastARPlaneAnchor = arPlaneAnchor;
        }
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject go = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            go.AddComponent <DontDestroyOnLoad> ();             //this is so these GOs persist across scene loads
            ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();

            arpag.planeAnchor = arPlaneAnchor;
            arpag.gameObject  = go;

            DebugPlaneTiler planeTiler = go.GetComponentInChildren <DebugPlaneTiler>();

            if (planeTiler)
            {
                planeTiler.AddToList();
            }

            planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);
        }
Пример #16
0
        public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
        {
            GameObject go = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);

            go.AddComponent <DontDestroyOnLoad> ();                     //this is so these GOs persist across scene loads
            ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();

            arpag.planeAnchor = arPlaneAnchor;
            arpag.gameObject  = go;
            planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);

            UnityARSessionNativeInterface.ARAnchorAddedEvent -= AddAnchor;


            //modified
            PlaneAppearDetector detector = generatedPlane;

            detector.planeDetect();
            detector = hitScript;
            detector.planeDetect();
            PlaneDetectorSwitcher switcher = Camera_managerScrpt;
        }