コード例 #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);
        }
コード例 #12
0
        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);
            }
        }
コード例 #13
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;

                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;
        }
コード例 #15
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;

            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;
        }