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


C# DragInfo类代码示例

本文整理汇总了C#中DragInfo的典型用法代码示例。如果您正苦于以下问题:C# DragInfo类的具体用法?C# DragInfo怎么用?C# DragInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DragInfo类属于命名空间,在下文中一共展示了DragInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DraggingHandler

    void DraggingHandler(DragInfo dragInfo)
    {
        if (debug) Debug.Log("====DraggingHandler====\n|| fingercount: " + dragInfo.fingerCount +
                                        " || index: " + dragInfo.index +
                                        " || isFlick: " + dragInfo.isFlick +
                                        " || pos: " + dragInfo.pos );

        if (dragInfo.pos.x / Screen.width <= 0.3)
        {
            yTouchLeft = dragInfo.pos.y / Screen.height;
            Debug.Log("Left: " + yTouchLeft );
        }

        if (dragInfo.pos.x / Screen.width >= 0.7)
        {
            yTouchRight = dragInfo.pos.y / Screen.height;
            Debug.Log("Right: " + yTouchRight );
        }

        speedModifier = (yTouchLeft >= yTouchRight) ? yTouchLeft : yTouchRight;

        directionModifier = yTouchLeft - yTouchRight;
        Debug.Log("Direction: " + directionModifier );

        Debug.Log("speedModifier: " + speedModifier );

        Vector3 pos = Megaman.transform.localPosition;
        pos.x = megamanInitialX + directionModifier*-1;
        float offsettedSpeedModifier = speedModifier - 0.5f;
        pos.z = megamanInitialZ + offsettedSpeedModifier;
        Megaman.transform.localPosition = pos;
        //Debug.Log("orbit.XModifier: "+orbit.XModifier);
    }
开发者ID:asglu,项目名称:supersomething,代码行数:33,代码来源:GameController.cs

示例2: DraggingStartHandler

 void DraggingStartHandler(DragInfo dragInfo)
 {
     if (debug) Debug.Log("====DraggingStartHandler====\n|| fingercount: " + dragInfo.fingerCount +
                          " || index: " + dragInfo.index +
                          " || isFlick: " + dragInfo.isFlick +
                          " || pos: " + dragInfo.pos );
 }
开发者ID:asglu,项目名称:supersomething,代码行数:7,代码来源:GameController.cs

示例3: OnDraggingEnd

        void OnDraggingEnd(DragInfo drag)
        {
            pointer.enabled = false;

            IT_Gesture.onMouse1E -= OnTouch;

            IT_Gesture.onDraggingEndE -= OnDraggingEnd;
        }
开发者ID:tetsujp84,项目名称:karaketsua,代码行数:8,代码来源:FMovePointer.cs

示例4: OnChargeForMove

        //スワイプによる移動操作検知
        void OnChargeForMove(DragInfo dragInfo)
        {
            //自分キャラ
            if (BCharacterManager.Instance.GetCharacterOnTile(dragInfo.pos) != this.character) return;

            //キャラクター移動用
            IT_Gesture.onDraggingEndE += OnDragMove;
        }
开发者ID:tetsujp84,项目名称:karaketsua,代码行数:9,代码来源:BCharacterMoverManual.cs

示例5: OnDraggingStart

        //移動開始
        void OnDraggingStart(DragInfo drag)
        {
            //タッチ位置取得

            dragPosition = drag.pos;
            IT_Gesture.onMouse1E += OnTouch;

            IT_Gesture.onDraggingEndE += OnDraggingEnd;
        }
开发者ID:tetsujp84,项目名称:karaketsua,代码行数:10,代码来源:FCharacter.cs

示例6: OnDrag

    void OnDrag(DragInfo info)
    {
        if (vertical) scrollDelta = info.delta.y;
        else scrollDelta = info.delta.x;

        MoveChildren(scrollDelta*scrollSpeed);

        scrollDelta /= Mathf.Abs(scrollDelta);
    }
开发者ID:90ninecents,项目名称:SWAPPZ-1,代码行数:9,代码来源:ScrollingPane.cs

示例7: OnDragging

 //called when one finger drag are detected
 void OnDragging(DragInfo dragInfo)
 {
     //apply the DPI scaling
     dragInfo.delta/=IT_Gesture.GetDPIFactor();
     //vertical movement is corresponded to rotation in x-axis
     this.orbitSpeedX=-dragInfo.delta.y* this.rotXSpeedModifier;
     //horizontal movement is corresponded to rotation in y-axis
     this.orbitSpeedY=dragInfo.delta.x* this.rotYSpeedModifier;
 }
开发者ID:SHEePYTaGGeRNeP,项目名称:GTO4Mobile,代码行数:10,代码来源:RTSCam_RotateObject.cs

示例8: OnDraggingStart

        //移動開始
        void OnDraggingStart(DragInfo drag)
        {
            //タッチ位置取得
            pointer.enabled = true;
            DragPosition = drag.pos;
            IT_Gesture.onMouse1E += OnTouch;

            IT_Gesture.onDraggingEndE += OnDraggingEnd;
        }
开发者ID:tetsujp84,项目名称:karaketsua,代码行数:10,代码来源:FMovePointer.cs

示例9: HandleGestureonDraggingStartE

 void HandleGestureonDraggingStartE(DragInfo dragInfo)
 {
     if (!isDragging) return;
     Transform puck = PickObject (dragInfo.pos);
     if (puck) {
         lastPuck = puck;
         baseHeight = puck.position.y;
         puck.renderer.material.color = Color.green;
     }
 }
开发者ID:thevole,项目名称:unitygestures,代码行数:10,代码来源:TouchPlay.cs

示例10: HandleDragging

 void HandleDragging(DragInfo dragInfo)
 {
     if (!isDragging) return;
     if (lastPuck) {
         DisplayText ("Dragging puck to: " + dragInfo.pos);
         Vector3 worldPos = GetWorldPos (dragInfo.pos);
         lastPuck.transform.position = worldPos;
     } else {
         DisplayText ("Dragging to: " + dragInfo.pos);
     }
 }
开发者ID:thevole,项目名称:unitygestures,代码行数:11,代码来源:TouchPlay.cs

示例11: Obj2ToCursor

    //assign dragObj2 to the dragInfo position, and display the appropriate tooltip
    void Obj2ToCursor(DragInfo dragInfo)
    {
        Vector3 p=Camera.main.ScreenToWorldPoint(new Vector3(dragInfo.pos.x, dragInfo.pos.y, 30));
        dragObj2.position=p;

        if(dragInfo.isMouse){
            dragTextMesh2.text="Dragging with mouse"+(dragInfo.index+1);
        }
        else{
            dragTextMesh2.text="Dragging with finger"+(dragInfo.index+1);
        }
    }
开发者ID:prasantha60,项目名称:PeoplePilot,代码行数:13,代码来源:TapDemo.cs

示例12: OnDragging

 //called when one finger drag are detected
 void OnDragging(DragInfo dragInfo)
 {
     //if the drag is perform using mouse2, use it as a two finger drag
     if(dragInfo.isMouse && dragInfo.index==1) OnMFDragging(dragInfo);
     //else perform normal orbiting
     else{
         //vertical movement is corresponded to rotation in x-axis
         orbitSpeedX=-dragInfo.delta.y*rotXSpeedModifier;
         //horizontal movement is corresponded to rotation in y-axis
         orbitSpeedY=dragInfo.delta.x*rotYSpeedModifier;
     }
 }
开发者ID:alusor,项目名称:Recompensas,代码行数:13,代码来源:RotateObject.cs

示例13: MouseRoutine

    IEnumerator MouseRoutine(int index)
    {
        mouseIndex.Add(index);

        bool dragStarted=false;

        Vector2 startPos=Input.mousePosition;
        Vector2 lastPos=startPos;

        float timeStart=Mathf.Infinity;

        while(mouseIndex.Contains(index)){

            Vector2 curPos=Input.mousePosition;

            if(!dragStarted){
                if(Vector3.Distance(curPos, startPos)>minDragDistance){
                    dragStarted=true;
                    Vector2 delta=curPos-startPos;
                    DragInfo dragInfo=new DragInfo(curPos, delta, 1, index, true);
                    IT_Gesture.DraggingStart(dragInfo);

                    timeStart=Time.realtimeSinceStartup;
                }
            }
            else{
                if(curPos!=lastPos){
                    Vector2 delta=curPos-lastPos;
                    DragInfo dragInfo=new DragInfo(curPos, delta, 1, index, true);
                    IT_Gesture.Dragging(dragInfo);
                }
                else if(fireOnDraggingWhenNotMoving){
                    DragInfo dragInfo=new DragInfo(curPos, Vector2.zero, 1, index, true);
                    IT_Gesture.Dragging(dragInfo);
                }
            }

            lastPos=curPos;

            yield return null;
        }

        if(dragStarted){
            bool isFlick=false;
            if(Time.realtimeSinceStartup-timeStart<0.5f) isFlick=true;

            Vector2 delta=lastPos-startPos;
            DragInfo dragInfo=new DragInfo(lastPos, delta, 1, index, isFlick, true);

            IT_Gesture.DraggingEnd(dragInfo);
        }
    }
开发者ID:hellaeon,项目名称:ballblazer,代码行数:52,代码来源:DragDetector.cs

示例14: OnDragging

    //called when one finger drag are detected
    void OnDragging(DragInfo dragInfo)
    {
        Debug.Log("drag "+dragInfo.delta);
        if(dragInfo.type!=2){
            //vertical movement is corresponded to rotation in x-axis
            orbitSpeedX=-dragInfo.delta.y*rotXSpeedModifier;
            //horizontal movement is corresponded to rotation in y-axis
            orbitSpeedY=dragInfo.delta.x*rotYSpeedModifier;
        }

        //if the drag is perform using mouse2, use it as a two finger drag
        if(dragInfo.type==2) OnDFDragging(dragInfo);
    }
开发者ID:johannaph,项目名称:nowBabyGit12,代码行数:14,代码来源:RTSCam.cs

示例15: OnDragging

 //called when one finger drag are detected
 void OnDragging(DragInfo dragInfo)
 {
     //if the drag is perform using mouse2, use it as a two finger drag
     if(dragInfo.isMouse && dragInfo.index==1) this.OnMFDragging(dragInfo);
     //else perform normal orbiting
     else{
         //apply the DPI scaling
         dragInfo.delta/=IT_Gesture.GetDPIFactor();
         //vertical movement is corresponded to rotation in x-axis
         this.orbitSpeedX=-dragInfo.delta.y* this.rotXSpeedModifier;
         //horizontal movement is corresponded to rotation in y-axis
         this.orbitSpeedY=dragInfo.delta.x* this.rotYSpeedModifier;
     }
 }
开发者ID:SHEePYTaGGeRNeP,项目名称:GTO4Mobile,代码行数:15,代码来源:RTSCam.cs


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