|
Post by letsketch on Jul 31, 2020 8:57:44 GMT
Hi,
Is there a way to trigger cell onMouseEnter/Exit events without disabling scrolling? (as opposed to onClick via SelectedDelegate)
Thanks!
|
|
|
Post by echo17 on Jul 31, 2020 12:45:57 GMT
Try OnPointerEnter, OnPointerExit instead for UI elements. Something like:
using UnityEngine; using UnityEngine.UI; using EnhancedUI.EnhancedScroller; using UnityEngine.EventSystems;
namespace EnhancedScrollerDemos.SuperSimpleDemo { /// <summary> /// This is the view of our cell which handles how the cell looks. /// </summary> public class CellView : EnhancedScrollerCellView, IPointerEnterHandler, IPointerExitHandler { /// <summary> /// A reference to the UI Text element to display the cell data /// </summary> public Text someTextText;
/// <summary> /// This function just takes the Demo data and displays it /// </summary> /// <param name="data"></param> public void SetData(Data data) { // update the UI text with the cell data someTextText.text = data.someText; }
public void OnPointerEnter(PointerEventData eventData) { Debug.Log("OnPointerEnter"); }
public void OnPointerExit(PointerEventData eventData) { Debug.Log("OnPointerExit"); } } }
|
|
|
Post by letsketch on Aug 1, 2020 1:06:27 GMT
*head slap* .. forgot IPointerEnterHandler, IPointerExitHandler. Works perfect. Thanks Layne.
|
|