I have several instantiated clones of a prefab. Each clone is assigned a different name corresponding to what the user inputs in a text field. Each name is put into a List.
I am able to get the number of times a clone has been clicked (Count) and I am able to check whether it is in the list. Then I am able to display the Count for each object.
If containsItem == true, and h++, how can I display the Count for ALL identical clones at the same time?
containsItem = data.Contains(EventSystem.current.currentSelectedGameObject.name); h = data.Where(s => s != null && s.Contains(EventSystem.current.currentSelectedGameObject.name)).Count() + 1; TMP_Text temp = EventSystem.current.currentSelectedGameObject.GetComponentInChildren<TextMeshProUGUI>(); temp.SetText(h.ToString());
Right now, the Count will update and display, but only on one clone at a time.