public void Start() { items = new List <FeatureSelectionItem> (); AR.Extras.FeatureCreator.FeatureReady += (object sender, EventArg <AR.Extras.Feature> e) => { GameObject itemGO = this.transform.Find("Items").gameObject; AR.Extras.Feature feature = e.arg; FeatureSelectionItem featureItem = Instantiate <FeatureSelectionItem>(itemPrefab, itemGO.transform, false); items.Add(featureItem); featureItem.transform.localScale = deselectedScale; featureItem.name = feature.featureName; featureItem.SetFeature(feature); }; AR.Extras.Feature.FeatureActivated += (object sender, EventArg <AR.Extras.Feature> e) => { foreach (FeatureSelectionItem item in items) { if (item.feature == e.arg) { item.transform.localScale = Vector3.one; } else { item.transform.localScale = deselectedScale; } } }; FeatureSelectionItem.Selected += (object sender, EventArg <FeatureSelectionItem> e) => { SimpleApplicationManager.Instance.SelectFeature(e.arg.feature); }; }
public void SetFeature(AR.Extras.Feature feature) { this.feature = feature; text.text = feature.name; button.onClick.AddListener(Select); }
public void SetFeatureInfo(AR.Extras.Feature src) { if (nameText != null) { nameText.text = src.featureName; } if (descriptionText != null) { descriptionText.text = src.description; } }