Esempio n. 1
0
    private void MoveInputs(TouchInformation touchInfo)
    {
        string info = touchInfo.GetSwipeDirection().ToString();

        switch (info)
        {
        case "Left": direction = 1f; break;

        case "Right": direction = -1f; break;

        case "None": direction = 0f; Fire(); break;

        default: break;
        }
    }
    void gameInput_SwipeEvent(TouchInformation touchInfo)
    {
        TouchInformation.ESwipeDirection swipeDirection = touchInfo.GetSwipeDirection();

        if (swipeDirection == TouchInformation.ESwipeDirection.Right)
        {
            ICommand moveCommand = new MoveCommand(Direction.right);
            moveCommand.Execute(toControl);
        }

        if (swipeDirection == TouchInformation.ESwipeDirection.Left)
        {
            ICommand moveCommand = new MoveCommand(Direction.left);
            moveCommand.Execute(toControl);
        }
    }
Esempio n. 3
0
        void HandleSwipeEvent(TouchInformation pTouchInfo)
        {
            if (KeyMappingTriggered == null)
            {
                return;
            }

            foreach (KeyMapping km in keyMappings)
            {
                if (km.isTap && km.swipeDirection == pTouchInfo.GetSwipeDirection())
                {
                    if (km.relativeScreenRect.Contains(pTouchInfo.RelativeScreenPosition))
                    {
                        KeyMappingTriggered(km.name);
                    }
                }
            }
        }
Esempio n. 4
0
    /// <summary>
    /// Handles the on swipe event. and calls keymapping delegates
    /// </summary>
    /// <param name='pTouchInfo'>
    /// _ti.
    /// </param>
    void HandleOnSwipeEvent(TouchInformation pTouchInfo)
    {
#if UNITY_ANDROID || UNITY_IOS || UNITY_BB10
        foreach (KeyMapping km in mKeyMappings)
        {
            if (km.mIsTap && km.mSwipeDirection == pTouchInfo.GetSwipeDirection())
            {
                if (km.mRelativeScreenRect.Contains(pTouchInfo.relativeScreenPosition))
                {
                    if (OnKeyMappingTriggered != null)
                    {
                        OnKeyMappingTriggered(km.mName);
                    }
                }
            }
        }
#endif
    }
Esempio n. 5
0
        void HandleSwipeEvent(TouchInformation pTouchInfo)
        {
            if(KeyMappingTriggered == null)
                return;

            foreach(KeyMapping km in keyMappings)
            {
                if(km.isTap && km.swipeDirection == pTouchInfo.GetSwipeDirection())
                {
                    if(km.relativeScreenRect.Contains(pTouchInfo.RelativeScreenPosition))
                    {
                        KeyMappingTriggered(km.name);
                    }
                }
            }
        }