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


C# Gesture.GetSwipeOrDragAngle方法代码示例

本文整理汇总了C#中Gesture.GetSwipeOrDragAngle方法的典型用法代码示例。如果您正苦于以下问题:C# Gesture.GetSwipeOrDragAngle方法的具体用法?C# Gesture.GetSwipeOrDragAngle怎么用?C# Gesture.GetSwipeOrDragAngle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gesture的用法示例。


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

示例1: On_Drag

 private void On_Drag(Gesture gesture)
 {
     if (gesture.pickObject == base.gameObject)
     {
         Vector3 touchToWordlPoint = gesture.GetTouchToWordlPoint(5f, false);
         base.transform.position = touchToWordlPoint - this.deltaPosition;
         this.textMesh.text = gesture.swipe.ToString() + " / angle :" + gesture.GetSwipeOrDragAngle().ToString("f2");
     }
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:9,代码来源:Drag.cs

示例2: On_SwipeEnd

 private void On_SwipeEnd(Gesture gesture)
 {
     if (this.trail != null)
     {
         UnityEngine.Object.Destroy(this.trail);
         float swipeOrDragAngle = gesture.GetSwipeOrDragAngle();
         object[] objArray1 = new object[] { "Last swipe : ", gesture.swipe.ToString(), " /  vector : ", gesture.swipeVector.normalized, " / angle : ", swipeOrDragAngle.ToString("f2"), " / ", gesture.deltaPosition.x.ToString("f5") };
         this.textMesh.text = string.Concat(objArray1);
     }
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:10,代码来源:Swipe.cs

示例3: On_SwipeEnd

    // At the swipe end
    private void On_SwipeEnd(Gesture gesture)
    {
        if (trail!=null){
            Destroy(trail);

            // Get the swipe angle
            float angles = gesture.GetSwipeOrDragAngle();
            textMesh.text = "Last swipe : " + gesture.swipe.ToString() + " /  vector : " + gesture.swipeVector.normalized + " / angle : " + angles.ToString("f2");
        }
    }
开发者ID:jinyangnet,项目名称:UndergroundAdventure,代码行数:11,代码来源:CameraSwipe.cs

示例4: On_SwipeEnd2Fingers

 private void On_SwipeEnd2Fingers(Gesture gesture)
 {
     if (this.trail != null)
     {
         UnityEngine.Object.Destroy(this.trail);
         float swipeOrDragAngle = gesture.GetSwipeOrDragAngle();
         object[] objArray1 = new object[] { "Last swipe : ", gesture.swipe.ToString(), " /  vector : ", gesture.swipeVector.normalized, " / angle : ", swipeOrDragAngle.ToString("f2") };
         this.textMesh.text = string.Concat(objArray1);
         EasyTouch.SetEnableTwist(true);
         EasyTouch.SetEnablePinch(true);
     }
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:12,代码来源:TwoSwipe.cs

示例5: On_Drag2Fingers

	// During the drag
	void On_Drag2Fingers(Gesture gesture){

		// Verification that the action on the object
		if (gesture.pickObject == gameObject){	
			Vector3 position = gesture.GetTouchToWordlPoint(  5);
			
			transform.position = position - deltaPosition;
			
			float angles =  gesture.GetSwipeOrDragAngle(); 
			
			textMesh.text = gesture.swipe.ToString() + " / angle :" + angles.ToString("f2");
		}
	}
开发者ID:jjhesk,项目名称:unity-interview,代码行数:14,代码来源:TwoDrag.cs

示例6: On_SwipeEnd2Fingers

	// At the swipe end
	void  On_SwipeEnd2Fingers( Gesture gesture){
		
	
		if (trail!=null){
			
			Destroy(trail);
			float  angles = gesture.GetSwipeOrDragAngle(); 
			
			
			textMesh.text = "Last swipe : " + gesture.swipe.ToString() + " /  vector : " + gesture.swipeVector.normalized + " / angle : " + angles.ToString("f2");
			EasyTouch.SetEnableTwist( true);
			EasyTouch.SetEnablePinch( true);	
				
		}
	}
开发者ID:ChadCSong,项目名称:Unity3DCarGameSample,代码行数:16,代码来源:TwoSwipe.cs

示例7: On_Drag2Fingers

    // During the drag
    void On_Drag2Fingers(Gesture gesture)
    {
        // Verification that the action on the object
        if (gesture.pickedObject == gameObject){

            // the world coordinate from touch
            Vector3 position = gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position);
            transform.position = position - deltaPosition;

            // Get the drag angle
            float angle = gesture.GetSwipeOrDragAngle();

            textMesh.text =   angle.ToString("f2") + " / " + gesture.swipe.ToString();
        }
    }
开发者ID:acorrow,项目名称:ToddlerPop,代码行数:16,代码来源:TwoDragMe.cs

示例8: On_Drag

    // During the drag
    void On_Drag(Gesture gesture)
    {
        // Verification that the action on the object
        if (gesture.pickObject == gameObject){

            // the world coordinate from touch for z=5
            Vector3 position = gesture.GetTouchToWordlPoint(5);

            transform.position = position - deltaPosition;

            // Get the drag angle
            float angle = gesture.GetSwipeOrDragAngle();

            textMesh.text = gesture.swipe.ToString() + " / angle :" + angle.ToString("f2");
        }
    }
开发者ID:nickmudry,项目名称:Lost-In-Space,代码行数:17,代码来源:Drag.cs

示例9: On_SwipeEnd

    // At the swipe end
    private void On_SwipeEnd(Gesture gesture)
    {
        if (trail!=null){
            Destroy(trail);

            // Get the swipe angle
            float angles = gesture.GetSwipeOrDragAngle();
            string s = "Last swipe : " + gesture.swipe.ToString() + " /  vector : " + gesture.swipeVector.normalized + " / angle : " + angles.ToString("f2") + " / " + gesture.deltaPosition.x.ToString("f5");

            string f =  gesture.swipe.ToString().ToLower();
            _Player = GameObject.Find ("clicken") ;
            if ( _Player )
            {
                print ("rrrrrrrrr") ;
                if (  f == "right" )
                    _Player.rigidbody.AddForce( new Vector3(6.0f,8.0f,0.0f),ForceMode.Impulse) ;
                else
                    _Player.rigidbody.AddForce( new Vector3(-2.0f,0.60f,0.0f),ForceMode.Impulse) ;
            }
            print ( s ) ;
        }
    }
开发者ID:jinyangnet,项目名称:UndergroundAdventure,代码行数:23,代码来源:PlayerSwipe.cs

示例10: On_SwipeEnd

	// At the swipe end 
	private void On_SwipeEnd(Gesture gesture){
		
		// Get the swipe angle
		float angles = gesture.GetSwipeOrDragAngle();
		swipeText.text = "Last swipe : " + gesture.swipe.ToString() + " /  vector : " + gesture.swipeVector.normalized + " / angle : " + angles.ToString("f2");
	}
开发者ID:krooq,项目名称:catotype,代码行数:7,代码来源:Swipe.cs

示例11: On_SwipeEnd

    // At the swipe end
    private void On_SwipeEnd(Gesture gesture)
    {
        if (trail != null)
        {
            if (cancelAttack)
            {
                cancelAttack = false;
                return;

            }
            if(PowerAttack)
                WeaponHand.StopVibrate();
           // WeaponHand.StopVibrate();
            // Get the swipe angle
            float angles = gesture.GetSwipeOrDragAngle();
           // Vector3 position = gesture.GetTouchToWordlPoint(10);
           // PlayerScript.mSingleton.Weapon.endSwingPosition(gesture.NormalizedPosition());
           // SwordStartEndPos[1] = position;
          //  SwordStartEndQ[1] = Quaternion.identity;
            WeaponScript.SwingDirection direction = WeaponScript.SwingDirection.None;

           // print("Last swipe : " + gesture.swipe.ToString() + " /  vector : " + gesture.swipeVector.normalized + " / angle : " + angles.ToString("f2") + " / " + gesture.deltaPosition.x.ToString("f5"));
           // print("Swipe Type " + gesture.swipe.ToString() + " Angle " + angles.ToString());

            if (gesture.swipe == EasyTouch.SwipeType.Other)
            {
                if (angles > -180 && angles < -90)
                {
                  //  print("Right up to left down");
                    direction = WeaponScript.SwingDirection.RightTop_LeftBot;

                }
                else if (angles > -90 && angles < 0)
                {
                   // print("Left Up to Right Down");
                    direction = WeaponScript.SwingDirection.LeftTop_RightBot;
                }

                else if (angles > 0 && angles < 90)
                {
                  //  print("Left Down to Right Up");
                    direction = WeaponScript.SwingDirection.LeftBot_RightTop;
                }

                else if (angles > 90 && angles < 180)
                {
                  //  print("Right Down to Left Up");
                    direction = WeaponScript.SwingDirection.RightBot_LeftTop;
                }

            }

            else
            {
                if (gesture.swipe == EasyTouch.SwipeType.Left)
                    direction = WeaponScript.SwingDirection.Right_Left;
                else if (gesture.swipe == EasyTouch.SwipeType.Right)
                    direction = WeaponScript.SwingDirection.Left_Right;
                else if (gesture.swipe == EasyTouch.SwipeType.Up)
                    direction = WeaponScript.SwingDirection.Bot_Top;
                else if (gesture.swipe == EasyTouch.SwipeType.Down)
                    direction = WeaponScript.SwingDirection.Top_Bot;

            }

            if (direction != WeaponScript.SwingDirection.None)
            {
                PlayerScript.mSingleton.Weapon.SwingWeapon(direction);
            }

            Destroy(trail);
            PowerAttack = false;
        }
    }
开发者ID:kewur,项目名称:BattleSlash,代码行数:75,代码来源:InputHandler.cs

示例12: On_Drag

 void On_Drag(Gesture gesture)
 {
     if(inputType == InputType.TOUCH){
         float dragAngle = gesture.GetSwipeOrDragAngle();
         DragHandler(gesture);
     }
 }
开发者ID:Nexters,项目名称:SpaceWar,代码行数:7,代码来源:InputManager.cs

示例13: DisplaySwipeAngle

 // Display swipe angle
 public void DisplaySwipeAngle(Gesture gesture)
 {
     float angle = gesture.GetSwipeOrDragAngle();
     textMesh.text =   angle.ToString("f2") + " / " + gesture.swipe.ToString();
 }
开发者ID:acorrow,项目名称:ToddlerPop,代码行数:6,代码来源:SimpleActionExample.cs

示例14: On_SwipeEnd

    // At the swipe end
    private void On_SwipeEnd(Gesture gesture)
    {
        if ( !IGManager.gm.IsPlaying()) return ;
        if ( _isJump ) return ;
        if (  gesture.swipeLength  < 20.0f )
        {
            tap(  gesture.position  ) ;
            return ;
        }

        // Get the swipe angle
        float angles = gesture.GetSwipeOrDragAngle();
        string s =  "  Last swipe : " + gesture.swipe.ToString() + " /  vector : " + gesture.swipeVector.normalized + " / angle : " + angles.ToString("f2") + " / " + gesture.deltaPosition.x.ToString("f5");
        string _swipe =  gesture.swipe.ToString().ToLower();

        if (  _swipe == "right" )
        {
            TabRight() ;
        }
        else
        {
            TabLeft();
        }

        //Swipe( _swipe , gesture.position );
    }
开发者ID:jinyangnet,项目名称:UndergroundAdventure,代码行数:27,代码来源:IGPlayerControl.cs


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