本文整理汇总了C#中Finger.GetGesture方法的典型用法代码示例。如果您正苦于以下问题:C# Finger.GetGesture方法的具体用法?C# Finger.GetGesture怎么用?C# Finger.GetGesture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Finger
的用法示例。
在下文中一共展示了Finger.GetGesture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateGesture
private void CreateGesture(int touchIndex,EventName message,Finger finger, SwipeDirection swipe, float swipeLength, Vector2 swipeVector){
bool firingEvent = true;
if (autoUpdatePickedUI && allowUIDetection){
finger.isOverGui = IsScreenPositionOverUI( finger.position );
finger.pickedUIElement = GetFirstUIElementFromCache();
}
// NGui
if (enabledNGuiMode && message == EventName.On_TouchStart){
finger.isOverGui = finger.isOverGui || IsTouchOverNGui(finger.position);
}
// firing event ?
if ((enableUIMode || enabledNGuiMode)){
firingEvent = !finger.isOverGui;
}
// The new gesture
Gesture gesture = finger.GetGesture();
// Auto update picked object
if (autoUpdatePickedObject && autoSelect){
if (message != EventName.On_Drag && message != EventName.On_DragEnd && message != EventName.On_DragStart){
if (GetPickedGameObject(finger)){
gesture.pickedObject = pickedObject.pickedObj;
gesture.pickedCamera = pickedObject.pickedCamera;
gesture.isGuiCamera = pickedObject.isGUI;
}
else{
gesture.pickedObject = null;
gesture.pickedCamera = null;
gesture.isGuiCamera = false;
}
}
}
gesture.swipe = swipe;
gesture.swipeLength = swipeLength;
gesture.swipeVector = swipeVector;
gesture.deltaPinch = 0;
gesture.twistAngle = 0;
// Firing event
if ( firingEvent){
RaiseEvent(message, gesture);
}
else if (finger.isOverGui){
if (message == EventName.On_TouchUp){
RaiseEvent(EventName.On_UIElementTouchUp, gesture);
}
else{
RaiseEvent(EventName.On_OverUIElement, gesture);
}
}
}