本文整理汇总了C#中UnityEngine.EventSystems.PointerEventData.IsPointerMoving方法的典型用法代码示例。如果您正苦于以下问题:C# PointerEventData.IsPointerMoving方法的具体用法?C# PointerEventData.IsPointerMoving怎么用?C# PointerEventData.IsPointerMoving使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.EventSystems.PointerEventData
的用法示例。
在下文中一共展示了PointerEventData.IsPointerMoving方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseMouse
static bool UseMouse( bool pressed, bool released, PointerEventData pointerData )
{
return pressed || released || pointerData.IsPointerMoving() || pointerData.IsScrolling();
}
示例2: ProcessDrag
/// <summary>
///
/// <para>
/// Process the drag for the current frame with the given pointer event.
/// </para>
///
/// </summary>
/// <param name="pointerEvent"/>
protected virtual void ProcessDrag(PointerEventData pointerEvent)
{
bool flag = pointerEvent.IsPointerMoving();
if (flag && (Object) pointerEvent.pointerDrag != (Object) null && (!pointerEvent.dragging && PointerInputModule.ShouldStartDrag(pointerEvent.pressPosition, pointerEvent.position, (float) this.eventSystem.pixelDragThreshold, pointerEvent.useDragThreshold)))
{
ExecuteEvents.Execute<IBeginDragHandler>(pointerEvent.pointerDrag, (BaseEventData) pointerEvent, ExecuteEvents.beginDragHandler);
pointerEvent.dragging = true;
}
if (!pointerEvent.dragging || !flag || !((Object) pointerEvent.pointerDrag != (Object) null))
return;
if ((Object) pointerEvent.pointerPress != (Object) pointerEvent.pointerDrag)
{
ExecuteEvents.Execute<IPointerUpHandler>(pointerEvent.pointerPress, (BaseEventData) pointerEvent, ExecuteEvents.pointerUpHandler);
pointerEvent.eligibleForClick = false;
pointerEvent.pointerPress = (GameObject) null;
pointerEvent.rawPointerPress = (GameObject) null;
}
ExecuteEvents.Execute<IDragHandler>(pointerEvent.pointerDrag, (BaseEventData) pointerEvent, ExecuteEvents.dragHandler);
}
示例3: UseMouse
private static bool UseMouse(bool pressed, bool released, PointerEventData pointerData)
{
if(pressed || released || pointerData.IsPointerMoving() || pointerData.IsScrolling())
return true;
return false;
}
示例4: ProcessDrag
protected virtual void ProcessDrag(PointerEventData pointerEvent)
{
bool flag = pointerEvent.IsPointerMoving();
if ((flag && (pointerEvent.pointerDrag != null)) && (!pointerEvent.dragging && ShouldStartDrag(pointerEvent.pressPosition, pointerEvent.position, (float) base.eventSystem.pixelDragThreshold, pointerEvent.useDragThreshold)))
{
ExecuteEvents.Execute<IBeginDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.beginDragHandler);
pointerEvent.dragging = true;
}
if ((pointerEvent.dragging && flag) && (pointerEvent.pointerDrag != null))
{
if (pointerEvent.pointerPress != pointerEvent.pointerDrag)
{
ExecuteEvents.Execute<IPointerUpHandler>(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
pointerEvent.eligibleForClick = false;
pointerEvent.pointerPress = null;
pointerEvent.rawPointerPress = null;
}
ExecuteEvents.Execute<IDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.dragHandler);
}
}
示例5: ProcessDrag
protected virtual void ProcessDrag(PointerEventData pointerEvent)
{
bool moving = pointerEvent.IsPointerMoving();
if (moving && pointerEvent.pointerDrag != null
&& !pointerEvent.dragging
&& ShouldStartDrag(pointerEvent.pressPosition, pointerEvent.position, eventSystem.pixelDragThreshold, pointerEvent.useDragThreshold))
{
ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.beginDragHandler);
pointerEvent.dragging = true;
}
// Drag notification
if (pointerEvent.dragging && moving && pointerEvent.pointerDrag != null)
{
// Before doing drag we should cancel any pointer down state
// And clear selection!
if (pointerEvent.pointerPress != pointerEvent.pointerDrag)
{
ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
pointerEvent.eligibleForClick = false;
pointerEvent.pointerPress = null;
pointerEvent.rawPointerPress = null;
}
ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.dragHandler);
}
}
示例6: IsPointerMoving
/// <summary>
/// The purpose of this function is to allow us to switch between using the standard IsPointerMoving
/// method for mouse driven pointers, but to always return true when it's a ray based pointer.
/// All real-world ray-based input devices are always moving so for simplicity we just return true
/// for them.
///
/// If PointerEventData.IsPointerMoving was virtual we could just override that in
/// OVRRayPointerEventData.
/// </summary>
/// <param name="pointerEvent"></param>
/// <returns></returns>
static bool IsPointerMoving(PointerEventData pointerEvent)
{
OVRRayPointerEventData rayPointerEventData = pointerEvent as OVRRayPointerEventData;
if (rayPointerEventData != null)
return true;
else
return pointerEvent.IsPointerMoving();
}
示例7: movePointer
/// <summary>
/// Moves injected pointer in UI.
/// </summary>
/// <param name="pointerEvent"> The pointer data. </param>
protected void movePointer(PointerEventData pointerEvent)
{
var targetGO = pointerEvent.pointerCurrentRaycast.gameObject;
HandlePointerExitAndEnter(pointerEvent, targetGO);
bool moving = pointerEvent.IsPointerMoving();
if (moving && pointerEvent.pointerDrag != null
&& !pointerEvent.dragging
&&
shouldStartDrag(pointerEvent.pressPosition, pointerEvent.position, eventSystem.pixelDragThreshold,
pointerEvent.useDragThreshold))
{
ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.beginDragHandler);
pointerEvent.dragging = true;
}
// Drag notification
if (pointerEvent.dragging && moving && pointerEvent.pointerDrag != null)
{
// Before doing drag we should cancel any pointer down state
// And clear selection!
if (pointerEvent.pointerPress != pointerEvent.pointerDrag)
{
ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
pointerEvent.eligibleForClick = false;
pointerEvent.pointerPress = null;
pointerEvent.rawPointerPress = null;
}
ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.dragHandler);
}
}
示例8: UseMouse
bool UseMouse( bool pressed, bool released, PointerEventData pointerData )
{
if (currentInputSource == InputSource.Mouse)
{
return true;
}
if (pressed || released || pointerData.IsPointerMoving() || pointerData.IsScrolling())
{
currentInputSource = InputSource.Mouse;
base.eventSystem.SetSelectedGameObject( null, pointerData );
}
return currentInputSource == InputSource.Mouse;
}