This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (var image in m_TempAugmentedImages) | |
{ | |
AugmentedImageVisualizer visualizer = null; | |
m_Visualizers.TryGetValue(image.DatabaseIndex, out visualizer); | |
if (image.TrackingState == TrackingState.Tracking && visualizer == null) | |
{ | |
// Create an anchor to ensure that ARCore keeps tracking this augmented image. | |
Anchor anchor = image.CreateAnchor(image.CenterPose); | |
visualizer = (AugmentedImageVisualizer)Instantiate(AugmentedImageVisualizerPrefab, anchor.transform); | |
visualizer.Image = image; | |
m_Visualizers.Add(image.DatabaseIndex, visualizer); | |
} | |
else if (image.TrackingState == TrackingState.Stopped && visualizer != null) | |
{ | |
m_Visualizers.Remove(image.DatabaseIndex); | |
GameObject.Destroy(visualizer.gameObject); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment