- Home /
Question by
CDAXRC · Nov 29, 2018 at 04:43 PM ·
triggereventsystempointer
OnPointerEnter works only if enter from blank space.
public class EventTriggerDelegateExample : MonoBehaviour
{
void Start()
{
EventTrigger trigger = GetComponent<EventTrigger>();
EventTrigger.Entry entry = new EventTrigger.Entry();
entry.eventID = EventTriggerType.PointerEnter;
entry.callback.AddListener((data) => { OnPointerEnterDelegate((PointerEventData)data); });
trigger.triggers.Add(entry);
}
public void OnPointerEnterDelegate(PointerEventData data)
{
Debug.Log("OnPointerEnterDelegate called.");
}
}
I'm using this code from documentation but it's only detect mouse enter from blank space. If mouse is over one panel and move to another panel, script don't call enter event.
img-20181129-174049.jpg
(202.2 kB)
Comment