/// <summary> /// 获取触摸移动方向的方法 /// </summary> /// <param name="gesture"></param> public void OnSwipe(SwipeGesture gesture) { // 完整的滑动数据 Vector2 move = gesture.Move; // 滑动的速度 float velocity = gesture.Velocity; // 大概的滑动方向 FingerGestures.SwipeDirection direction = gesture.Direction; if (direction.ToString() == "Left") { Audiomanagement.B_Click_Audio_Source("Turn_over_aBook"); print(direction.ToString()); autoFlip.FlipRightPage(); } else { Audiomanagement.B_Click_Audio_Source("Turn_over_aBook"); print(direction.ToString()); autoFlip.FlipLeftPage(); } }
void Swipe_Gesture(SwipeGesture e) { Vector2 move = e.Move; float velocity = e.Velocity; FingerGestures.SwipeDirection direction = e.Direction; int angle = direction.ToString() == "Left" ? 45 : -45; MyGestureParameter mgp = new MyGestureParameter("swipe"); mgp.angle = angle; pctrl.SetGesture(mgp); }