本文整理汇总了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");
}
}
示例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);
}
}
示例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");
}
}
示例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);
}
}
示例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");
}
}
示例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);
}
}
示例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();
}
}
示例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");
}
}
示例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 ) ;
}
}
示例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");
}
示例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;
}
}
示例12: On_Drag
void On_Drag(Gesture gesture)
{
if(inputType == InputType.TOUCH){
float dragAngle = gesture.GetSwipeOrDragAngle();
DragHandler(gesture);
}
}
示例13: DisplaySwipeAngle
// Display swipe angle
public void DisplaySwipeAngle(Gesture gesture)
{
float angle = gesture.GetSwipeOrDragAngle();
textMesh.text = angle.ToString("f2") + " / " + gesture.swipe.ToString();
}
示例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 );
}