private void CreateDetectors()
        {
            DCSettings settings = DCSettings.Instance;

            DCSettings.Gesture openWithTouch = settings.openWithGesture;
            switch (openWithTouch)
            {
            case DCSettings.Gesture.None:
                break;

            case DCSettings.Gesture.SWIPE_DOWN_WITH_1_FINGER:
                m_swipeDetector = new SwipeTouchDetector(1);
                break;

            case DCSettings.Gesture.SWIPE_DOWN_WITH_2_FINGERS:
                m_swipeDetector = new SwipeTouchDetector(2);
                break;

            case DCSettings.Gesture.SWIPE_DOWN_WITH_3_FINGERS:
                m_swipeDetector = new SwipeTouchDetector(3);
                break;
            }

            KeyCode key = settings.openWithKey;

            m_keyDownDetector = new KeyDownDetector(key);
        }
Beispiel #2
0
        private void InitOperationTips()
        {
            DCSettings settings  = DCSettings.Instance;
            string     tips      = null;
            string     operation = null;

            bool useTouch = PlatformUtil.IsMobilePlatform();

            if (useTouch)
            {
                string             touch   = "";
                DCSettings.Gesture gesture = settings.openWithGesture;
                switch (gesture)
                {
                case DCSettings.Gesture.SWIPE_DOWN_WITH_1_FINGER:
                    touch = "1 finger";
                    break;

                case DCSettings.Gesture.SWIPE_DOWN_WITH_2_FINGERS:
                    touch = "2 fingers";
                    break;

                case DCSettings.Gesture.SWIPE_DOWN_WITH_3_FINGERS:
                    touch = "3 fingers";
                    break;
                }
                operation = string.Format("Swipe down with <color={0}>{1}</color>", KEY_COLOR, touch);
            }
            else
            {
                KeyCode key = settings.openWithKey;
                operation = string.Format("Press the key <color={0}>{1}</color>", KEY_COLOR, key.ToString());
            }

            if (operation != null)
            {
                tips = string.Format("{0} to open the console.", operation);
            }

            if (tips != null)
            {
                uiOperationTips.text = tips;
            }
        }