Skip to main content

Posts

Showing posts with the label simple swipe

Simple swipe and tap on mobile phone

 Simple swipe and tap on mobile phone   private  Vector3 fp ;     //First touch position      private  Vector3 lp ;     //Last touch position      private   float  dragDistance ;    //minimum distance for a swipe to be registered        void  Start ( )      {         dragDistance  =  Screen . height   *   15   /   100 ;   //dragDistance is 15% height of the screen      }        void  Update ( )      {          if   ( Input . touchCount   ==   1 )   // user is touching the screen with a single touch          {             Touch touch  =  Input . GetTouch ( 0 ) ;   // get the touch              i...