public void RemoveAnchor(ARPlaneAnchor arPlaneAnchor) { if (planeAnchorMap.ContainsKey (arPlaneAnchor.identifier)) { ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier]; GameObject.Destroy (arpag.gameObject); planeAnchorMap.Remove (arPlaneAnchor.identifier); } }
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; } }
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); }
public void RemoveAnchor(ARPlaneAnchor arPlaneAnchor) { if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier)) { ARPlaneAnchorGameObject aRPlaneAnchorGameObject = planeAnchorMap[arPlaneAnchor.identifier]; UnityEngine.Object.Destroy(aRPlaneAnchorGameObject.gameObject); planeAnchorMap.Remove(arPlaneAnchor.identifier); } }
public Transform GetGroundPlane(string groundPlaneIdentifier) { if (planeAnchorMap.ContainsKey(groundPlaneIdentifier)) { ARPlaneAnchorGameObject arpag = planeAnchorMap[groundPlaneIdentifier]; return(arpag.gameObject.transform); } return(null); }
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; } }
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); } }
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; } }
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); }
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; } }
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(); } } }
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); }
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; }