private void GenerateTransitionLines() { LinkedListNode <string> it = anchorList.First; while (it != anchorList.Last) { AnchorPosition baseAnchor = null; AnchorPosition targetAnchor = null; foreach (AnchorPosition anchorPos in SceneAnchorPositions) { if (anchorPos.SpatialAnchorObject.Name == it.Value) { baseAnchor = anchorPos; } if (anchorPos.SpatialAnchorObject.Name == it.Next.Value) { targetAnchor = anchorPos; } } if (baseAnchor != null && targetAnchor != null) { baseAnchor.ConnectToAnchor(targetAnchor); } else { Debug.Log($"Cannot find the anchor connecting to {it.Value}"); break; } it = it.Next; } }
private IEnumerator GenerateTransitionLines() { Debug.Log("Generating transition lines"); //for(int i=SceneAnchorPositions.Count-1; i > 0; i--) //{ // SceneAnchorPositions[i].ConnectToAnchor(SceneAnchorPositions[i - 1]); // Debug.Log($"Connecting {SceneAnchorPositions[i].SpatialAnchorObject.Name} and {SceneAnchorPositions[i - 1].SpatialAnchorObject.Name}"); // yield return null; //} LinkedListNode <string> it = anchorList.First; while (it != anchorList.Last) { AnchorPosition baseAnchor = null; AnchorPosition targetAnchor = null; foreach (AnchorPosition anchorPos in SceneAnchorPositions) { if (anchorPos.SpatialAnchorObject.Name == it.Value) { baseAnchor = anchorPos; } if (anchorPos.SpatialAnchorObject.Name == it.Next.Value) { targetAnchor = anchorPos; } } if (baseAnchor != null && targetAnchor != null) { Debug.Log($"Connecting {baseAnchor.SpatialAnchorObject.Name} and {targetAnchor.SpatialAnchorObject.Name}"); baseAnchor.ConnectToAnchor(targetAnchor); } else { Debug.Log($"Cannot find the anchor connecting to {it.Value}"); break; } it = it.Next; yield return(null); } }