Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Any Swipe

Discussion in 'Assets and Asset Store' started by UpInteractive, May 29, 2015.

  1. UpInteractive

    UpInteractive

    Joined:
    Mar 15, 2012
    Posts:
    100

    AnySwipe.png

    (Version 1)
    What this is

    This is an easy to use solution for detecting swipes in any direction for IOS, Android and even from the Unity editor if using Unity Remote. Could also be use for the web player and standalone builds with the mouse. Javascript, and C# supported. Here is a video demonstration of what this is like.

    How To Use

    In order to detect swipes, all you have to do is reference one scripts called “AnySwipe” into your project, and call the appropriate functions from within it. This scripts is only composed of two functions.

    AnySwipeMainFunctions.png

    You must call IsSwiped() first to check if a swipe was detected or else it will display the following error message.

    ErrorMessage.png

    You can then use CheckForSwipe(Vector2 swipe) to determined exactly the kind of swipe it is. Please take a look at the following video tutorial on how to use this script.



    Demo

    Click on the following link if you would like to try out a web player version of the demo scene.


    API
    AnySwipeAPI.png
    Contact

    If you have any problems or issue can contact me at the following email address.

    upthereinteractive@yahoo.com



     

    Attached Files:

    • Icon.png
      Icon.png
      File size:
      21.1 KB
      Views:
      829
    theANMATOR2b likes this.
  2. UpInteractive

    UpInteractive

    Joined:
    Mar 15, 2012
    Posts:
    100

    Version 2 of AnySwipe is now up on the Asset Store, updated it to take time into consideration if need to when detecting swipes. Here is a video demonstration of what this is like.​




    Here is an update web play version of it if you would like to try it out
    WebPlayer

    Updated Inspector
    Screen Shot 2015-07-07 at 12.38.18 AM.png
    Here Time Limit is the min time allowed in order to consider a swipe to be a swipe or else won’t do anything (IsSwiped() won’t return true). If less then zero then time won’t be taken in consideration in determining if a swipe occurred.