private void LoadPanel() { var testPanel = GameObject.FindGameObjectWithTag("TestPanel"); var testPanelEventTrigger = testPanel.GetComponentInChildren <EventTrigger>(); UIHelper.AddEventTrigger(testPanelEventTrigger, DisplayDebugText, EventTriggerType.PointerEnter); }
private void LoadCharacter() { GameObject characterObject = (GameObject)Instantiate(characterPrefab); var characterPanel = UIHelper.getGameObjectWithName(characterObject, "PanelOverlay", typeof(RectTransform)); //var characterEventTrigger = characterPanel.AddComponent<EventTrigger>(); var characterEventTrigger = characterObject.GetComponentInChildren <EventTrigger>(); UIHelper.AddEventTrigger(characterEventTrigger, DisplayDebugText, EventTriggerType.PointerEnter); characterObject.transform.position = new Vector3(2.5f, 2.5f, -1); }