private void Start() { hotspotsManager = HotspotsManager.GetInstance(); float buttonHeight = hotspotButtonPrefab.GetComponent <RectTransform>().rect.height; ButtonContainer.GetComponent <RectTransform>().sizeDelta = new Vector2(720, hotspotsManager.hotspots.Count * buttonHeight); for (int index = 0; index < hotspotsManager.hotspots.Count; index++) { Button newButton = Instantiate(hotspotButtonPrefab, new Vector3(0, 0, 0), Quaternion.identity).GetComponent <Button>(); hotspotButtonList.Add(newButton); newButton.transform.SetParent(ButtonContainer.transform); newButton.transform.localPosition = new Vector3(0, -index * buttonHeight, 0); newButton.transform.localScale = Vector3.one; var detailButton = newButton.GetComponent <HotspotDetailButton>(); detailButton.informationPanel = informationPanel; } }
private void OnTrackedImageChanged(ARTrackedImagesChangedEventArgs trackedImageEventArgs) { foreach (var trackedImage in trackedImageEventArgs.added) { hotspot = HotspotsManager.GetInstance().UnlockHotspot(trackedImage.referenceImage.name); storyButton.gameObject.SetActive(true); storyText.text = hotspot.hotspotTextMansfeldDialog[currentDialogIndex]; if (hotspot.unlocked == false) { hotspot.unlocked = true; } } foreach (var trackedImage in trackedImageEventArgs.updated) { if (dynamicAnimation.MansfeldCharacter == null) { Debug.Log(trackedImage.transform.position); dynamicAnimation.Tracked(trackedImage.transform.position); } } }