IMHOTEP Framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
CustomEvents.cs
1 using UnityEngine.EventSystems;
2 
3 
4 namespace UI
5 {
6  // Adopted from https://gist.github.com/stramit/76e53efd67a2e1cf3d2f
7  // Extends the ExecuteEvents so that it can use our self-defined event handlers, like IPointerMoveHandler:
8  public static class CustomEvents
9  {
10  // call that does the mapping
11  private static void Execute(IPointerHoverHandler handler, BaseEventData eventData)
12  {
13  // The ValidateEventData makes sure the passed event data is of the correct type
14  handler.OnPointerHover (ExecuteEvents.ValidateEventData<PointerEventData> (eventData));
15  }
16 
17  // helper to return the functor that should be invoked
18  public static ExecuteEvents.EventFunction<IPointerHoverHandler> pointerHoverHandler
19  {
20  get { return Execute; }
21  }
22  }
23 
24 }