public void OnPointerClick(PointerEventData eventData) { string panelTime = transform.name.Replace("HourPanel", ""); string clickedTime; if (panelTime.Length < 2) { clickedTime = "0" + panelTime; } else { clickedTime = panelTime; } // Get text from weekday Transform dayTextPanel = transform.parent.parent.parent.Find("DayTextPanel"); Text dayText = dayTextPanel.Find("DayText").GetComponent <Text>(); tc.AddNewEventClick(clickedTime, dayText.text); }