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. Dismiss Notice

[RELEASED] EASY TOUCH V2.0 : Solution for touchscreen mouse

Discussion in 'Assets and Asset Store' started by Hedgehog-Team, Sep 17, 2012.

  1. Hedgehog-Team

    Hedgehog-Team

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

    Click here for a web player demo

    EasyTouch allow you to quickly and easily develop actions based on a touchscreen or a mouse .

    All major gestures are recognized such as touch, tap, double tape, twist, pinch.. and much more.

    EasyTouch allows automatic detection of all gameobjects with collider on collision layers that you can set, To allow easy handling of the various elements that make up your scene

    EasyTouch 2.0 is written in C# , it notifies you of an action on the touch screen or with mouse by events. The events are sent by delegate system for C # or internal messaging function of Unity (SendMessage) for Javascript developers.

    Each event passes a parameter class, with all the informations about the current action (position, angle, picked object ...)

    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

    Link to Asststore

    What's new in 2.0

    News
    * C# migration
    * Implementing delegate for sending messages. (Broadcast messages is retained with a parameter for javascript developers)
    * 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
    * New documentation

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

    Gesture class
    * Add method (GetScreenToWordlPoint( float z) that return the world coordinate position for a camera and z position
    * Add method (GetSwipeRrDragAngle()) that return the swipe or drag angle in degree

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

    maiko

    Joined:
    Sep 18, 2012
    Posts:
    2
    Hey man thanks I'm going to check it out tonight. I was sort of sad that you ditched JS in this version, I'm more comfortable with it hehe.
     
  3. Hedgehog-Team

    Hedgehog-Team

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

    Many users have asked me for a C # migration, but I kept ease of use for javascript developer. You just need to place the plugins directory to the root of your project select Broadcast message in the inspector. Everything else is as before :)

    Warning there are also multiple management layer.

    I hope that you will appreciate as the javascript version
     
    Last edited: Sep 18, 2012
  4. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Is there any documentation for javascript users?
     
  5. Hedgehog-Team

    Hedgehog-Team

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

    In the documentation, there is how to use Easy Touch with C# or Javascript (And the difference between the two)

    I just tell to Maiko how to do in case he had not yet read the new docuementation.
     
  6. xrvel

    xrvel

    Joined:
    Jan 29, 2012
    Posts:
    12
    Can you sell another version of easy touch that is readily integrated with first person character controller?
    So that user can move by mouse instead of using A+S+D+W maybe by 2 clicks, hold and drag, pinch etc? :)
     
  7. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    There is a simple example of a freecamera with EasyTouch.

    For a FPS controler, the better is an joystick .I had the idea to build an extension to EasyTouch, which include several games controlers, easily integrable.
    but with EasyTouch you have everything you need to write these controler.

    For the moment I do not know yet if I will do it.
     
  8. xrvel

    xrvel

    Joined:
    Jan 29, 2012
    Posts:
    12
    im not really good on unity programming so it will help if you sell another integration between EasyTouch and controller :)
     
  9. cobanonur

    cobanonur

    Joined:
    Oct 31, 2012
    Posts:
    5
    Hey, I just bought easytouch from asset store. However I need easyjoystick script. it is not in the easytouch folders. Please help me .
     
  10. Hedgehog-Team

    Hedgehog-Team

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

    I'm not referring to Easy Joystick in the description of package EasyTouch. EasyJoystick isn't releasead yet, it's still in developpement ....

    Coming soon....

    Nicolas
     
  11. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
  12. domjon

    domjon

    Joined:
    Oct 14, 2012
    Posts:
    12
    I recently purchased Easy Touch, and I'm super happy with it, but I'm running into a problem with multiple states being called...

    Right before EasyTouch registers Pinching, it calls On_SimpleTap2Fingers.

    This is a problem because in my game two-finger tap does something I don't want to happen when the user pinches.

    Also On_SimpleTap is called twice when tapping with two fingers... so if you tapped with two it would call both On_SimpleTap twice AND On_SimpleTap2Fingers (which I had to solve by using if EasyTouch.GetTouchCount() == 1)

    I'd love for every one of these functions to be separate states, and not to be called simultaneously. Is there something that can be done to fix this? Or at least in my specific case?

    Thanks, I really do love this plugin and want to see it get even better!
     
  13. Hedgehog-Team

    Hedgehog-Team

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

    For the event On_SimpleTap2Fingers I look, because it seems strange to me, there may be a bug ... I would inform you that I found the problem.

    But that EasyTouch sends events on each button it is wanted, and your test is what to do. I could add a parameter which prohibits the sending indivuel event for a 2-finger gesture. But this feature is used very useful to be able to intercept each events during a multi-finger gesture

    You use C # or Javascript?
     
  14. domjon

    domjon

    Joined:
    Oct 14, 2012
    Posts:
    12
    Thanks for the quick reply!

    I'm using C#.

    Ohh okay, I will keep using if EasyTouch.GetTouchCount() == 1 for SimpleTap, I can see now how that would be needed for buttons etc.
     
  15. Hedgehog-Team

    Hedgehog-Team

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

    You can use this : gesture.touchCount ==1, look at Gesture class documentation. It's the class as passed as parameter in each event.
     
  16. Hedgehog-Team

    Hedgehog-Team

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

    I found the problem, it comes from the tolerance zone. If you swipe too fast and it is still in the area.

    I'll fix it in the next version, which incorporates EasyJoystick (in few weeks). In the meantime if you have a lot of problem with this, send me an email on the address The.Hedgehog.Team @ gmail.com with your invoice number.
     
  17. booyagrandmma

    booyagrandmma

    Joined:
    Mar 26, 2012
    Posts:
    11
    Hi, i'm having an issue and i'm not sure how to overcome this. Basically my game is a joystick on the left, and a button / action area on the right. One of my actions is a swipe, and when the joystick is the first finger down, the second finger swiping is ignored. Is there a way to determine swipes of a second finger?
     
  18. Hedgehog-Team

    Hedgehog-Team

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

    First, do you use Javascript or C# ?

    Easytouch manages each touch individually, so you can have a swipe on different finger at the same time, and I have to redo the test case, and it's work ...

    In the method of On_Swipe, you can use the member fingerIndex of the classe gesture which is passed as parameter, to know which what finger is in action. And the member touchcount to know how many touches are on.

    If you wish to treatment swipe on several fingers at the same time, you must identify each finger; and manage n the swipe method on the index finger
     
  19. booyagrandmma

    booyagrandmma

    Joined:
    Mar 26, 2012
    Posts:
    11
    I'm using c#. No matter how many fingers i have swiping, in the method On_Swipe, the gesture.fingerIndex always returns a 0, and never sees any swipes past that.
     
  20. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    It is very strange, it works very well for me. I'll give you an example. Allow me a few minutes to do so.
     
  21. Hedgehog-Team

    Hedgehog-Team

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

    You can download HERE a simple demo with multi swipe.

    This example draws trails under each finger ...



    The source code
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Swipe1 : MonoBehaviour {
    5.  
    6.     private GameObject[] trail= new GameObject[10];
    7.    
    8.     // Subscribe to events
    9.     void OnEnable(){
    10.         EasyTouch.On_SwipeStart += On_SwipeStart;
    11.         EasyTouch.On_Swipe += On_Swipe;
    12.         EasyTouch.On_SwipeEnd += On_SwipeEnd;      
    13.     }
    14.  
    15.     void OnDisable(){
    16.         UnsubscribeEvent();
    17.        
    18.     }
    19.    
    20.     void OnDestroy(){
    21.         UnsubscribeEvent();
    22.     }
    23.    
    24.     void UnsubscribeEvent(){
    25.         EasyTouch.On_SwipeStart -= On_SwipeStart;
    26.         EasyTouch.On_Swipe -= On_Swipe;
    27.         EasyTouch.On_SwipeEnd -= On_SwipeEnd;  
    28.     }
    29.    
    30.    
    31.     // At the swipe beginning
    32.     private void On_SwipeStart( Gesture gesture){
    33.        
    34.         if (trail[gesture.fingerIndex]==null){
    35.            
    36.             // the world coordinate from touch for z=5
    37.             Vector3 position = gesture.GetTouchToWordlPoint(5);
    38.             trail[gesture.fingerIndex ] = Instantiate( Resources.Load("Trail"),position,Quaternion.identity) as GameObject;
    39.         }
    40.     }
    41.    
    42.     // During the swipe
    43.     private void On_Swipe(Gesture gesture){
    44.        
    45.         if (trail[gesture.fingerIndex]!=null){
    46.            
    47.             // the world coordinate from touch for z=5
    48.             Vector3 position = gesture.GetTouchToWordlPoint(5);
    49.             trail[gesture.fingerIndex ].transform.position = position;
    50.         }
    51.     }
    52.    
    53.     // At the swipe end
    54.     private void On_SwipeEnd(Gesture gesture){
    55.        
    56.         if (trail[gesture.fingerIndex]!=null){
    57.             Destroy(trail[gesture.fingerIndex ]);          
    58.         }
    59.                
    60.     }
    61. }
     
  22. booyagrandmma

    booyagrandmma

    Joined:
    Mar 26, 2012
    Posts:
    11
    Thanks so much for that! Fantastic product btw.
     
  23. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    I also have a good new version 2.5 of EasyTouch with Easy Joystick is released.

    EasyJoystick allow you to create a virtual joystick in few secondes ...
    2 new WebPlayer here and here

    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)



    Code (csharp):
    1.  
    2. /// Release notes V2.5 November 2012
    3. /// =============================
    4. ///     * EasyJoystick
    5. ///     --------------
    6. ///     - First release of EasyJoystick
    7. ///
    8. ///     * EasyTouch class
    9. ///     -----------------
    10. ///     - Add static method IsRectUnderTouch : to get if a touch is in a rect.
    11. ///
    12. ///     * Inpsector
    13. ///     ------------
    14. ///     - New inspector style for pro  free skin
    15. ///     - Add hierarchy icon to identify EasyTouch gameObject
    16. ///
    17. ///     * Gesture class
    18. ///     -----------------
    19. ///     - Add method IsInRect( Rect rect) that return true if the touch is in the rect.
    20. ///
    21. ///     * Bugs fixed
    22. ///     ------------
    23. ///     - Fix 2 static methods that didn't properly reference the  EasyTouch instance
     
  24. alekolpz

    alekolpz

    Joined:
    Dec 7, 2012
    Posts:
    8
    Easy touch works on monitors with touchscreen enabled?
     
  25. Hedgehog-Team

    Hedgehog-Team

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

    EasyTouch uses Unity API, so you are on PC or Mac with monitors with touchscreen that simulate the mouse, it'will work like on Unity Editor

    Nicolas
     
  26. gringo2012

    gringo2012

    Joined:
    Jul 6, 2012
    Posts:
    46
    Hi

    I have the same question and problem. I have an Acer t232HL touch monitor with windows 8 but it does not work with EasyTouch.
    Do you have any idea if you could add the support for this?
    It would mean a lot for me to be able to test the games straight in the editor, in Windows, with the touch monitor rather than compiling the game each time and tweak it...

    Thanks for the great job so far.

    A+
     
  27. Hedgehog-Team

    Hedgehog-Team

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

    Unity add support to Window Phone 8, but I don't know how they manage the touch. But they never say that Unity support Window 8 touch monitor

    I don't have window 8, and I don't have Window phone 8, sorry

    I use Unity API, if Unity doesn't support them, I can't do nothing
     
    Last edited: Aug 23, 2013
  28. gringo2012

    gringo2012

    Joined:
    Jul 6, 2012
    Posts:
    46
  29. raybarrera

    raybarrera

    Joined:
    Nov 20, 2010
    Posts:
    207
    Having a bit of an issue here. I have a huge ring that I rotate with drag and swipe, then I have buttons on that ring that I get touch events from using On_SimpleTap. Everything works perfectly fine on mac editor with a mouse. When I build to iPad 2 though, I get no On_SimpleTab events. Any thoughts? Thanks.
     
  30. Hedgehog-Team

    Hedgehog-Team

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

    On_SimpleTap doesn't work but swipe and drag work and IPAD2 ?

    Do you change the Stationnary tolerance ?

    Can you tell me if OneFinger example work on your Ipad2 ?