当前位置: 首页>>代码示例>>C#>>正文


C# PointerEventData.IsPointerMoving方法代码示例

本文整理汇总了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();
 }
开发者ID:TrinketBen,项目名称:Courier,代码行数:4,代码来源:InControlInputModule.cs

示例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);
 }
开发者ID:NetherDrk,项目名称:Eternal-Empire,代码行数:27,代码来源:PointerInputModule.cs

示例3: UseMouse

        private static bool UseMouse(bool pressed, bool released, PointerEventData pointerData)
        {
            if(pressed || released || pointerData.IsPointerMoving() || pointerData.IsScrolling())
                return true;

            return false;
        }
开发者ID:smchamplin16,项目名称:VRApocalypse,代码行数:7,代码来源:RewiredStandaloneInputModule.cs

示例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);
     }
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:20,代码来源:PointerInputModule.cs

示例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);
            }
        }
开发者ID:gdzzzyyy,项目名称:UGUIlok,代码行数:28,代码来源:PointerInputModule.cs

示例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();
 }
开发者ID:sirerr,项目名称:projectlily,代码行数:19,代码来源:OVRInputModule.cs

示例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);
            }
        }
开发者ID:TerisseNicolas,项目名称:Archip3l,代码行数:37,代码来源:TouchScriptInputModule.cs

示例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;
		}
开发者ID:benlewis,项目名称:unhinged_vr,代码行数:15,代码来源:InControlInputModule.cs


注:本文中的UnityEngine.EventSystems.PointerEventData.IsPointerMoving方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。