duck

duck

Jun 29th, 2010
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. private var draggedObject : Draggable;
  3.  
  4. function Update ()
  5. {    
  6.     if (iPhoneInput.touchCount >= 1)
  7.     {
  8.         touch = iPhoneInput.touch[0];
  9.    
  10.         if (touch.phase == iPhoneTouchPhase.Began)
  11.         {
  12.             // determine whether a draggable object was touched,
  13.             // if so, put it in "draggedObject"
  14.         }
  15.    
  16.         if (touch.phase == iPhoneTouchPhase.Moved && detectingMotion == true)
  17.         {
  18.             // if currently dragging an object, send the current point to the object
  19.             // (so the object adds it to its own internal array of points to move through)
  20.            
  21.         }
  22.    
  23.         if (touch.phase == iPhoneTouchPhase.Ended)
  24.         {
  25.             draggedObject = null;
  26.         }        
  27.     }    
  28.  
  29. }
Add Comment
Please, Sign In to add comment