void UpdateInstruction(ARTrackedImage trackedImage) { var planeParentGo = trackedImage.transform.GetChild(0).gameObject; var planeGo = planeParentGo.transform.GetChild(0).gameObject; var canvasGroup = trackedImage.GetComponentInChildren <CanvasGroup>(); var text = trackedImage.GetComponentInChildren <Text>(); // Disable/Enable the visuals based on if this is the current instruction and it is tracked if (trackedImage == currentInsruction && trackedImage.trackingState != TrackingState.None) { planeGo.SetActive(true); canvasGroup.alpha = 1f; // The image extents is only valid when the image is being tracked trackedImage.transform.localScale = new Vector3(trackedImage.size.x, trackedImage.size.y, trackedImage.size.y); // Set the texture var material = planeGo.GetComponentInChildren <MeshRenderer>().material; material.mainTexture = (trackedImage.referenceImage.texture == null) ? defaultTexture : trackedImage.referenceImage.texture; // Update the step number if (stepper != null) { text.text = "Step: " + stepper.GetCurrentStep().Number; } } else { planeGo.SetActive(false); canvasGroup.alpha = 0f; } }