namespace UnityEngine.EventSystems
{
///
/// Base class that all EventSystem events inherit from.
///
public interface IEventSystemHandler
{
}
///
/// Interface to implement if you wish to receive OnPointerEnter callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IPointerEnterHandler : IEventSystemHandler
{
///
/// Use this callback to detect pointer enter events
///
void OnPointerEnter(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnPointerExit callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IPointerExitHandler : IEventSystemHandler
{
///
/// Use this callback to detect pointer exit events
///
void OnPointerExit(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnPointerDown callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IPointerDownHandler : IEventSystemHandler
{
///
/// Use this callback to detect pointer down events.
///
void OnPointerDown(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnPointerUp callbacks.
/// Note: In order to receive OnPointerUp callbacks, you must also implement the EventSystems.IPointerDownHandler|IPointerDownHandler interface
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IPointerUpHandler : IEventSystemHandler
{
///
/// Use this callback to detect pointer up events.
///
void OnPointerUp(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnPointerClick callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
///
/// Use the IPointerClickHandler Interface to handle click input using OnPointerClick callbacks. Ensure an Event System exists in the Scene to allow click detection. For click detection on non-UI GameObjects, ensure a EventSystems.PhysicsRaycaster is attached to the Camera.
///
///
///
/// using UnityEngine;
/// using UnityEngine.EventSystems;
///
/// public class Example : MonoBehaviour, IPointerClickHandler
/// {
/// //Detect if a click occurs
/// public void OnPointerClick(PointerEventData pointerEventData)
/// {
/// //Output to console the clicked GameObject's name and the following message. You can replace this with your own actions for when clicking the GameObject.
/// Debug.Log(name + " Game Object Clicked!");
/// }
/// }
///
///
public interface IPointerClickHandler : IEventSystemHandler
{
///
/// Use this callback to detect clicks.
///
void OnPointerClick(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnBeginDrag callbacks.
/// Note: You need to implement IDragHandler in addition to IBeginDragHandler.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IBeginDragHandler : IEventSystemHandler
{
///
/// Called by a BaseInputModule before a drag is started.
///
void OnBeginDrag(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnInitializePotentialDrag callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IInitializePotentialDragHandler : IEventSystemHandler
{
///
/// Called by a BaseInputModule when a drag has been found but before it is valid to begin the drag.
///
void OnInitializePotentialDrag(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnDrag callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
///
///
/// using UnityEngine;
/// using UnityEngine.EventSystems;
/// using UnityEngine.UI;
///
/// [RequireComponent(typeof(Image))]
/// public class DragMe : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
/// {
/// public bool dragOnSurfaces = true;
///
/// private GameObject m_DraggingIcon;
/// private RectTransform m_DraggingPlane;
///
/// public void OnBeginDrag(PointerEventData eventData)
/// {
/// var canvas = FindInParents
///
public interface IDragHandler : IEventSystemHandler
{
///
/// When dragging is occurring this will be called every time the cursor is moved.
///
void OnDrag(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnEndDrag callbacks.
/// Note: You need to implement IDragHandler in addition to IEndDragHandler.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IEndDragHandler : IEventSystemHandler
{
///
/// Called by a BaseInputModule when a drag is ended.
///
void OnEndDrag(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnDrop callbacks.
///
///
///
/// using UnityEngine;
/// using UnityEngine.EventSystems;
///
/// public class DropMe : MonoBehaviour, IDropHandler
/// {
/// public void OnDrop(PointerEventData data)
/// {
/// if (data.pointerDrag != null)
/// {
/// Debug.Log ("Dropped object was: " + data.pointerDrag);
/// }
/// }
/// }
///
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IDropHandler : IEventSystemHandler
{
///
/// Called by a BaseInputModule on a target that can accept a drop.
///
void OnDrop(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnScroll callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IScrollHandler : IEventSystemHandler
{
///
/// Use this callback to detect scroll events.
///
void OnScroll(PointerEventData eventData);
}
///
/// Interface to implement if you wish to receive OnUpdateSelected callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IUpdateSelectedHandler : IEventSystemHandler
{
///
/// Called by the EventSystem when the object associated with this EventTrigger is updated.
///
///
///
/// using UnityEngine;
/// using UnityEngine.EventSystems;
///
/// public class UpdateSelectedExample : MonoBehaviour, IUpdateSelectedHandler
/// {
/// public void OnUpdateSelected(BaseEventData data)
/// {
/// Debug.Log("OnUpdateSelected called.");
/// }
/// }
///
///
void OnUpdateSelected(BaseEventData eventData);
}
///
/// Interface to implement if you wish to receive OnSelect callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface ISelectHandler : IEventSystemHandler
{
void OnSelect(BaseEventData eventData);
}
///
/// Interface to implement if you wish to receive OnDeselect callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IDeselectHandler : IEventSystemHandler
{
///
/// Called by the EventSystem when a new object is being selected.
///
void OnDeselect(BaseEventData eventData);
}
///
/// Interface to implement if you wish to receive OnMove callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface IMoveHandler : IEventSystemHandler
{
///
/// Called by a BaseInputModule when a move event occurs.
///
void OnMove(AxisEventData eventData);
}
///
/// Interface to implement if you wish to receive OnSubmit callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface ISubmitHandler : IEventSystemHandler
{
void OnSubmit(BaseEventData eventData);
}
///
/// Interface to implement if you wish to receive OnCancel callbacks.
///
///
/// Criteria for this event is implementation dependent. For example see StandAloneInputModule.
///
public interface ICancelHandler : IEventSystemHandler
{
void OnCancel(BaseEventData eventData);
}
}