Hi, I have several canvas group for my UI system and I want to know if the mouse is over one of my canvas groups and know which one it is ?
I tried this but I have only the list of UI elements, not the their group, any way to know if they are attached to a group ?
PointerEventData pointerEventData = new PointerEventData(EventSystem.current);
pointerEventData.position = Input.mousePosition;
List<RaycastResult> raycastList = new List<RaycastResult>();
EventSystem.current.RaycastAll(pointerEventData, raycastList);
for (int i = 0; i < raycastList.Count; i++)
{
Debug.Log(raycastList[i].gameObject.name + " " + i);
}
Thanks !
ibyte
2
Did you ever find the answer?