Dans Unity3d Comment détecter le toucher sur l'INTERFACE utilisateur ou pas?

En faire Unity3d application mobile. Et j'ai un problème: Comment détecter le toucher sur l'INTERFACE utilisateur ou pas?

J'ai essayer ça (mais maintenant, le travail)

UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject()

et ce

private static List<RaycastResult> tempRaycastResults = new List<RaycastResult>();

public bool PointIsOverUI(float x, float y)
{
    var eventDataCurrentPosition = new PointerEventData(EventSystem.current);

    eventDataCurrentPosition.position = new Vector2(x, y);

    tempRaycastResults.Clear();

    EventSystem.current.RaycastAll(eventDataCurrentPosition, tempRaycastResults);

    return tempRaycastResults.Count > 0;
}
InformationsquelleAutor Knaus Irina | 2015-10-23