當前位置: 首頁>>代碼示例>>C#>>正文


C# Gesture.CanPreventGesture方法代碼示例

本文整理匯總了C#中TouchScript.Gestures.Gesture.CanPreventGesture方法的典型用法代碼示例。如果您正苦於以下問題:C# Gesture.CanPreventGesture方法的具體用法?C# Gesture.CanPreventGesture怎麽用?C# Gesture.CanPreventGesture使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TouchScript.Gestures.Gesture的用法示例。


在下文中一共展示了Gesture.CanPreventGesture方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: canPreventGesture

 private bool canPreventGesture(Gesture first, Gesture second)
 {
     bool result = true;
     if (GlobalGestureDelegate != null) result = !GlobalGestureDelegate.ShouldRecognizeSimultaneously(first, second);
     return result && first.CanPreventGesture(second);
 }
開發者ID:oafkad,項目名稱:TouchScript,代碼行數:6,代碼來源:GestureManagerInstance.cs

示例2: recognizeGesture

 private void recognizeGesture(Gesture gesture)
 {
     var gestures = getHierarchyContaining(gesture.transform);
     foreach (var otherGesture in gestures)
     {
         if (gesture == otherGesture) continue;
         if (!gestureIsActive(otherGesture)) continue;
         if (!(otherGesture.State == Gesture.GestureState.Began || otherGesture.State == Gesture.GestureState.Changed) &&
             gesture.CanPreventGesture(otherGesture))
         {
             failGesture(otherGesture);
         }
     }
 }
開發者ID:kod3r,項目名稱:TouchScript,代碼行數:14,代碼來源:TouchManager.cs

示例3: recognizeGestureIfNotPrevented

        private bool recognizeGestureIfNotPrevented(Gesture gesture)
        {
            if (!gesture.ShouldBegin()) return false;

            bool canRecognize = true;
            List<Gesture> gesturesToFail = new List<Gesture>(10);
            var gestures = getHierarchyContaining(gesture.transform);

            foreach (var otherGesture in gestures)
            {
                if (gesture == otherGesture) continue;
                if (!gestureIsActive(otherGesture)) continue;

                if (otherGesture.State == Gesture.GestureState.Began || otherGesture.State == Gesture.GestureState.Changed)
                {
                    if (otherGesture.CanPreventGesture(gesture))
                    {
                        canRecognize = false;
                        break;
                    }
                }
                else
                {
                    if (gesture.CanPreventGesture(otherGesture))
                    {
                        gesturesToFail.Add(otherGesture);
                    }
                }
            }

            if (canRecognize)
            {
                foreach (var otherGesture in gesturesToFail)
                {
                    failGesture(otherGesture);
                }
            }

            return canRecognize;
        }
開發者ID:Jashengmato,項目名稱:TouchScript,代碼行數:40,代碼來源:GestureManagerInstance.cs

示例4: recognizeGestureIfNotPrevented

        private bool recognizeGestureIfNotPrevented(Gesture gesture)
        {
            if (!gesture.ShouldBegin()) return false;

            var gesturesToFail = gestureListPool.Get();
            var gesturesInHierarchy = gestureListPool.Get();
            bool canRecognize = true;
            getHierarchyContaining(gesture.transform, gesturesInHierarchy);

            var count = gesturesInHierarchy.Count;
            for (var i = 0; i < count; i++)
            {
                var otherGesture = gesturesInHierarchy[i];
                if (gesture == otherGesture) continue;
                if (!gestureIsActive(otherGesture)) continue;

                if (otherGesture.State == Gesture.GestureState.Began || otherGesture.State == Gesture.GestureState.Changed)
                {
                    if (otherGesture.CanPreventGesture(gesture))
                    {
                        canRecognize = false;
                        break;
                    }
                }
                else
                {
                    if (gesture.CanPreventGesture(otherGesture))
                    {
                        gesturesToFail.Add(otherGesture);
                    }
                }
            }

            if (canRecognize)
            {
                count = gesturesToFail.Count;
                for (var i = 0; i < count; i++)
                {
                    failGesture(gesturesToFail[i]);
                }
            }

            gestureListPool.Release(gesturesToFail);
            gestureListPool.Release(gesturesInHierarchy);

            return canRecognize;
        }
開發者ID:RainsSoft,項目名稱:TouchScript,代碼行數:47,代碼來源:GestureManagerInstance.cs

示例5: failGesture

            TouchRadius = .75f;
        }

        private void failGesture(Gesture gesture)
        {
            gesture.SetState(Gesture.GestureState.Failed);
        }

        private bool gestureCanRecognize(Gesture gesture)
        {
            if (!gesture.ShouldBegin()) return false;

            var gestures = getHierarchyContaining(gesture.transform);
            foreach (var otherGesture in gestures) {
                if (gesture == otherGesture) continue;
                if (!gestureIsActive(otherGesture)) continue;
開發者ID:gijs,項目名稱:TouchScript,代碼行數:16,代碼來源:TouchManager.cs


注:本文中的TouchScript.Gestures.Gesture.CanPreventGesture方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。