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; DebugPlaneTiler planeTiler = go.GetComponentInChildren <DebugPlaneTiler>(); if (planeTiler) { planeTiler.AddToList(); } planeAnchorMap.Add(arPlaneAnchor.identifier, arpag); }