Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Easy Touch

Discussion in 'Assets and Asset Store' started by Hedgehog-Team, May 8, 2012.

  1. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    EasyTouch 3.1 is available Link to Asset Store

    Web Player

    Forum support

    Allows you to quickly and easily develop actions based on a touchscreen, joystick button. All major gestures are recognized by EasyTouch such as tap, double tap, swipe, twist, pinch...


    * New Multi-Cameras support
    * New NGUI support
    * New EasyJoystick 2.0
    * New EasyButton 1.0
    * New Reserved area<br>
    * and much more...Click here


    * All major gestures are recognized in the same time
    * Automatic object selection and multi layers <br>
    * Remote support<br>
    * Second finger simulation<br>

    You have all you need to create your game on mobile device, developed for mobile platforms has never been easier


    EasyTouch is written in C#, it notifies you of an action by events. The events are sent by delegate system or internal messaging function of Unity


    EasyJoystick allow you to create a virtual joystick in few seconde
    Simpler than a long explanation, here are two videos showing you the possibility of joystick (hd mode is better) (sorry for my english)
    Integrating charactercontroller


    some parameter of EasyJoystick (it was the alpha version)
     
    Last edited: Oct 8, 2013
    Gozdek likes this.
  2. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Nice, is it in javascript or c#?

    And how do I simulate 2 fingers with mouse on the web player?
     
  3. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    It is in Javascript, but in a "plugins" folder, so you can use it with C#.

    EasyTouch simulates the second finger when you press the ALT or CTRL key, an orange circle appears on the screen to the simulated position.

    ALT => For twist or pinch gesture
    CTRL => For swipe or drag gesture

    Or both simultaneously


    Nicolas
     
    Last edited: May 13, 2012
  4. whazlewo

    whazlewo

    Joined:
    May 17, 2012
    Posts:
    6
    Is Swipe a special case at all? I have a game object working fine with tap

    Code (csharp):
    1.  
    2. function On_SimpleTap( gesture:Gesture)
    3. {
    4.     Debug.Log("TAP!");
    5. }
    6.  
    But when I try to add Swipe i get no response

    Code (csharp):
    1.  
    2. function On_Swipe(gesture:Gesture)
    3. {  
    4.     Debug.Log("SWIPE!");
    5. }
    6.  
    I noticed in your example files you attached swipe to the same object as your EasyTouch init stuff, but I thought that the object you wanted to interact with had to be on layer 8 and have a collider.

    Fantastic library by the way. Other than not being able to get at Swipe, this has saved me a ton of time.

    Richie
     
  5. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi !

    If you "swipe" on an object that is set in auto-select (layer + collider), you must use Drag message.
    And your script (not the easytouch.js) must be on the object that received the touch

    Code (csharp):
    1. Function On_Drag(gesture:Gesture){
    2.       Debug.Log("SWIPE!");
    3. }
    Swipe = Gesture without an object under the start of the touch
    Drag = Gesture with an Object under the start od the touch

    Let's have a look at "Example-OneFinger" :
    * Load the scene example "OneFinger"
    * Easytouch.js is attached to an Empty Game Object
    * Drag.js is attached to a sphere that you can move

     
    Last edited: May 18, 2012
  6. whazlewo

    whazlewo

    Joined:
    May 17, 2012
    Posts:
    6
    Ahh, I think I get it. Just drag on an item without moving it. I even see that I can still access the swipe direction from the gesture! This package is very nicely written.
     
  7. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    I'm glad you like it
     
  8. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Many people asked me for the documentation before making the acquisition of Easy Touch.

    You can download : Here
     
  9. Filax

    Filax

    Guest

    Joined:
    Mar 30, 2011
    Posts:
    8
    Just bought it :) Excellent library !!

    I made my first ipad touch demo in two seconds.... No complicated delegate or prefab, just one script to drop on a game object.

    Excellent work ! more of this.
     
  10. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Thank you,

    We always try to keep it simple ... The establishment of design Partern or C # is not for me a symbol of quality in all cases.

    I know that for many users a library written in javascript is not a synonym of professional, I will never understand reasoning ... (why do simple when you can complicate :) )

    The only limitation of Easytouch is your imagination...
     
  11. Filax

    Filax

    Guest

    Joined:
    Mar 30, 2011
    Posts:
    8
    i agree... what do you plan for the rest ? new library ?
     
  12. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    We continue to enrich our offerings pakage media (skybox, effect, Nature).

    The next library will be a library of artificial intelligence to the towers. It will automatically acquire their targets in different ways
    The towers will shoot and acquire their targets while they are moving ... And possess the usual rules for paramaters ...

    I say no more :)
     
  13. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    I have buy 1.0 version. Is update free?
     
  14. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    Yes, all update will be free.

    But I have not received any bug, or requests for changes from users. I plan a C# migration with delegates (I will still keep sendmessage for javascript users, by a parameter)
     
  15. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    Sorry, I don't understand how update... I buy another time from asset store?
     
  16. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    NO

    * Click on "MY STUFF" button on the bottom right.
    * You will see all the package you buy or free package that you are imported.
    * Click on "See complete list"
    * => You can now, Download / Import / write a review ... (choose by clicking on combo button)

    This is when changing the text presentation that I made a mistake by version 1.1, but there is no difference with version 1.0. But You Can download it again.

    You have some issue with Easy Touch ?

    do not forget to write a little review, this is always fun and allows other users to make their choice.
     
    Last edited: Jul 15, 2012
  17. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I'm facing an problem when trying to use it with C# code, because Javascript is somehow not compiled in the same time as C#, it gives undefined classes. The workaround is to put EasyTouch in Standard Assets folder, so Javascript gets compiled there it. It's an annoyance as I put my packages in an external folder, a C# version is preferred.
     
  18. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    To use EasyTouch with C#, you must put the plugins folder in the root of your project. or Put the js script in Standard Assets folder.


    Nicolas
     
  19. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    The problem is the same for people using javascript with C # classes ....
     
  20. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Indeed. Good package but C# version please
     
  21. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Ok, it's my plan for my summer holiday...
     
  22. fadzuli

    fadzuli

    Joined:
    Sep 22, 2010
    Posts:
    15
    In the TwoFinger example, I added On_SimpleTap to the Pinch script. On_SimpleTap fires at the end of a pinch gesture. I tested this on an iOS device. Can you fix this?

    When will the C# update be out?

    Can you add support for touching multiple layers? i.e using LayerMask for pickableLayers instead of int.
     
  23. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    Can you post your changes because I do not quite understand that you do exactly, and explain the bugs.

    I'm a little late because I have not been able to work this summer.For managing multi layer, I will integrate it, it's a good idea.
     
  24. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    I forgot the layer is stored in an int, but I use a layermask. Look at the function GetPickeGameObject
     
  25. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    I watched what you describe. This is not a bug.

    In all scenarios, all events are sent for each fingers. So you receive events for each finger gesture and events over two fingers.

    To correct your script just to test the number of touches like this :

    Code (csharp):
    1. function On_SimpleTap( gesture:Gesture){
    2.     if (gesture.touchCount==1){
    3.     ......
    4.     }
    5. }
     
  26. fadzuli

    fadzuli

    Joined:
    Sep 22, 2010
    Posts:
    15
    I did test the number of touches. It is actually possible depending on the way you lift two fingers off the screen (One after the other) to get one On_SimpleTap event with 2 touch count and a second On_SimpleTap event with 1 touch count and that makes it hard to differentiate between the end of a pinch gesture and a simple tap gesture.

    I feel that there should be a version of On_SimpleTap that fires just one time regardless of the number of fingers involved in it and should only fire if the same number of fingers went down and up again.
     
  27. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    What you ask is very complex, because you can lift a finger and down a another in the same time, in this case the number of touches is always the same but there was a touch up (or tap) in one finger and a touchstart whit another. That is why there is the number of touches and the finger index in the Gesture class

    Tell me what you want to do concretely (and not an example exercise), because I do not understand your problem
     
  28. fadzuli

    fadzuli

    Joined:
    Sep 22, 2010
    Posts:
    15
    I have a tile map and a character. When the player taps on the character, I will show the tiles it can walk to. When the player taps on a tile, the character will move there. When I tap outside the walkable tiles I will cancel the character selection. I have a pinch and zoom camera in and out and a twist to rotate camera feature which allows the player to look around the tile map while the character is selected. Unfortunately, pinch and twist will fire On_SimpleTap events which will accidentally move the player or cancel the character selection.
     
  29. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    it's look like image manipulation example....

    Do you add : " if (gesture.touchCount==1)" in you On_SimpleTap message ?

    Do you have one script that receive all messages or multi-script whith auto-select ?
     
  30. fadzuli

    fadzuli

    Joined:
    Sep 22, 2010
    Posts:
    15
    Yes I have "if (gesture.touchCount==1)" in my script.

    I use one script with auto select switched on like the image manipulation example. I am not sure how does this affect what I want to achieve.

    The problem is still there that at the end of a pinch gesture it is still possible for a On_SimpleTap to fire with a touch count of 1.
     
  31. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    I have not reproduced this case, is it possible to send me your project, or examples with this one problem.

    I ask you if you use the auto select, because for me it would use 3 scripts

    - 1 on Camera
    - 1 on Player
    - 1 on tiled

    With a redirect on the camera that would interpret the movements of swipe and pinch.
     
  32. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Just for a test :
    * can you replace your On_SimpleTap by On_TouchStart and keep if (gesture.touchCount==1 ) in it.
     
  33. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    Here is the release notes for version 2.0 of EasyTouch, which will be soon available in the asset store :

    * News
    - C# migration
    - Implementing delegate for sending messages. (Broadcast messages is retained with a parameter for javascript developpers)
    - Management of multiple layer for the auto selection
    - Management of fake singleton, in case you have more than one EasyTouch per scene by error
    - Add custom inspector
    - Add Debug.LogError if no camera with flag MainCamera was found in the scene

    * EasyTouch class
    - remove SetPickableLayer GetPickableLayer static methods
    - Add static method GetTouchCount : to get the number of touches.

    * Gesture class
    - Add method GetTouchToWordlPoint( float z) that return the world coordinate position for z position
    - Add method GetSwipeOrDragAngle() that return the swipe or drag angle in degree (Calculate with Swipe vector)

    * Bugs fixed
    - On_DragEnd2Fingers and On_SwipeEnd2Fingers messages were sent to wrong during a drag or a swipe.
    - On_Cancel2Fingers is now correctly sent to the picked object (if auto-select)

    @Fadzuli : I'm always waiting for your project example ...
     
    Last edited: Sep 13, 2012
  34. fadzuli

    fadzuli

    Joined:
    Sep 22, 2010
    Posts:
    15
    Nicholas, thanks for helping to resolve the above issue I was having. I look forward to see the update soon. Also, congratulations on your c# release!
     
  35. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    The correction shall be incorporated in the updated version 2.1 available next week.

    Thank you to Fadzuli for time to test the correction.
     
  36. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    I try to make javascript that use swipe (iPad) for slide from image to another.
    I see your example and I try to replicate in javascript, but no working result. I have some question:
    1 - The swipe script can be attached to an object that isn't place in EasyTouch layer?
    2 - Can c++ and javascript use at same time or can be problem?


    This is my simple script only for see if swipe work:

    Code (csharp):
    1.  
    2. #pragma strict
    3. var SwipeD : Vector2;
    4.  
    5. function Start(){  
    6. }
    7.  
    8. function Update () {
    9. Debug.Log (SwipeD );
    10. }
    11.  
    12. function On_SwipeStart( gesture:Gesture){
    13. }
    14.  
    15. function On_Swipe( gesture:Gesture){
    16. }
    17.  
    18. function On_SwipeEnd( gesture:Gesture){
    19.         SwipeD = gesture.swipeVector.normalized;
    20. }
    This script only see me swipe direction on console, but no result.
    It is attached on object (default layer).
    EasyTouch plugin is on right place.
    Can you help me?
     
  37. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    In first, are are using 1.0 or 2.0 version of EasyTouch?.

    Your script is correct and you say yourself, the console displays the direction of the swipe, so you are receiving information.

    Now it's up to you to encode the movement of the camera or image when you receive this information.

    The gesture class gives you more information without recourse to normalize.

    I need more information about your goal
     
  38. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    Easytouch 2.0.
    The problem is that console don't display nothing...
    I see your swipe script (C++) works on object without collider. Swipe can be work without collider?
    In my scene i have another script to use ET to drag/zoom a plane (image).

    My goal:
    Simple gallery like iPad: image on scene (plane with texture). I can make drag/zoom operation and go next or previous with swipe.
    I hope I explained.
     
  39. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    To help you, the best thing is that you see an example in javascript :

    1- Created a new project and import EasyTouch

    2 - Assured yourself that the plugins directory is in the root of your project

    3 - download this package is the example: OneFinger javascript, Import it into your project

    4 - Load scene in example folder.


    I hope this will help you, otherwise send ma a private message with your msn or you skype

    Do not forget to also read the doc ...
     
  40. benfattino

    benfattino

    Joined:
    Nov 26, 2010
    Posts:
    43
    Thanks. I try this:
    - Create new project
    - Download and import EasyTouch, plugin folder on root directory
    - Download your example and load (fixed some mixed link)

    I found this problem.
    If I enable auto-select touch, tap, drag operation works but not swipe.
    If I disable auto-select only swipe work.
    I try to apply swipe script to the background (with collider) but no result.
    I think I'll start using C...
     
  41. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    The difference between a swipe and drag depends on whether an object is selectable at the start of the touch.

    If no object is found it is a swipe, if an object is found it is a drag.
    In the example there are two processing drag ans swipe in the same scene

    if you want to manage only one swipe even if an object is below the button, javascript simply determine an other receiver with the static method (look at gamecontroller demo) that will receive a copy of all the messages, and treat swipe and drag to identical
     
  42. berney

    berney

    Joined:
    Sep 11, 2012
    Posts:
    10
    Hi,

    Just bought EasyTouch 2.0 and got a quick question. My player has the option to swipe anywhere on the screen while hitting objects that are located on the swipe trail. Is there an easy way of doing it with ET 2.0? gesture.pickObject dows not work on swipes, so the only thing left for me is to detect myself in the On_Swipe event if the specific GameObject location overlaps with the swipe position.

    Thanks.
     
  43. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    you're very lucky, the 2.2 update is available since this morning and it just brings a new static method to know if an object is under a touch.


    Look at Release note and the example game controller has been changed with this new method
     
  44. berney

    berney

    Joined:
    Sep 11, 2012
    Posts:
    10
    Thanks :) will try that.
     
  45. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi,

    I just bought EasyTouch 2.2 to replace my own touchscript because i needed better swipe up, down, left and right gestures. No what i had is one script (TouchControls) which handled all the touch and was added to the Main Camera. Is this also possible with EasyTouch? Because i have some objects which i need to be able to swipe without using a collider.
    My original touch code is like this snippet i made:
    Code (csharp):
    1.  
    2. private var human : GameObject;
    3.  
    4. function Awake()
    5. {
    6.      human = GameObject.Find("Human");
    7. }
    8.  
    9. //when swiping
    10. function Swiping()
    11. {
    12.     touchDeltaPosition = Input.GetTouch(0).deltaPosition;
    13.    
    14.     if(touchDeltaPosition.y > -10  touchDeltaPosition.y < 10)
    15.         touchDeltaPosition.y = 0;
    16.    
    17.     if(touchDeltaPosition.x > 0)
    18.     {
    19.         swipeRight = true;
    20.         swipeLeft = false;
    21.     }
    22.     else
    23.     {
    24.         swipeLeft = true;
    25.         swipeRight = false;
    26.     }
    27.    
    28.     if(touchDeltaPosition.y > 0)
    29.     {
    30.         swipeUp = true;
    31.         swipeDown = false;
    32.     }
    33.     else if(touchDeltaPosition.y  < 0)
    34.     {
    35.         swipeDown = true;
    36.         swipeUp = false;
    37.     }
    38.    
    39.     if(swipeLeft || swipeRight)
    40.     {
    41.         human.transform.Rotate(Vector3.down * touchDeltaPosition.x * Time.deltaTime * speed);
    42.     }
    43. }
    44.  
    Since my human doesn't have a collider, can i use the swipe gestures from EasyTouch?
     
  46. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    The difference between a swipe and drag depends on whether an object is selectable at the start of the touch. In C# all events will be received by the subscribers,in javascipt is the bearer of the script or the selected object that receives the event

    You can use the swipe as same way as you do in your script, or use the drag but for that, you need to add a collider on your character, and the beginning of the action must be on the character.

    Look at Onefinger scene where you have swipe and drag simple example.

    Let me know if the explanation is clear enough and if the example has convinced you
     
  47. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi,

    Thx for your reply! But i can't give my human object a collider due to other problems i have when the human has a collider (and believe me i tried). So is it possible to do it without a collider?

    Thx!
     
  48. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Yes, off course.

    Let me 10 minutes I am writing a script where a cube responded to swipe event
     
  49. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Me again :)

    Here is a very simple example ...
    - Createa new scene
    - Add a cube
    - Place the camera in front of the cube.
    - Add script EasyTouch.cs on camera
    - Add the following script on your cube

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class SwipeWOCollider : MonoBehaviour {
    6.    
    7.     public float speed= 10;
    8.    
    9.     void OnEnable(){
    10.         EasyTouch.On_Swipe += On_Swipe;
    11.     }
    12.  
    13.     void OnDestroy(){
    14.         EasyTouch.On_Swipe -= On_Swipe;
    15.     }
    16.    
    17.    
    18.     private void On_Swipe(Gesture gesture){
    19.         if (gesture.swipe == EasyTouch.SwipeType.Left || gesture.swipe== EasyTouch.SwipeType.Right){
    20.             transform.Rotate( new Vector3(0,-gesture.deltaPosition.x * speed * Time.deltaTime,0));
    21.         }
    22.     }
    23. }
    24.  
    25.  
     
  50. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Wow nice thx man :) i'll check it out tonight!