- Home /
This question was
closed Mar 08, 2019 at 02:48 PM by
Thephil2988 for the following reason:
I solved it
Question by
Thephil2988 · Mar 01, 2019 at 12:26 PM ·
uieventsystemui imagescrollviewmouseover
Click on image in scrollview
So this is an oddly specific question, but how do i detect if my mouse is hovering over an ui image that i have inside a scrollview?
This is my code using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems;
public class EnlargePictures : MonoBehaviour
{
public bool isOver = false;
public void OnPointerEnter(PointerEventData eventData)
{
Debug.Log("Mouse enter");
isOver = true;
}
public void OnPointerExit(PointerEventData eventData)
{
Debug.Log("Mouse exit");
isOver = false;
}
}
I have a 2d collider on my image, physics 2d raycaster on camera, Event trigger on image and Event system in world.
Comment