Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1.         if (Input.GetMouseButtonDown(0))
  2.         {
  3.             firstPosition = playerGameCamera.ScreenToWorldPoint(Input.mousePosition);
  4.         }
  5.         if (Input.GetMouseButton(0))
  6.         {
  7.             secondPosition = playerGameCamera.ScreenToWorldPoint(Input.mousePosition);
  8.  
  9.             Vector3 fPos = (Input.mousePosition - firstPosition);
  10.             Vector3 sPos = (Input.mousePosition - secondPosition);
  11.  
  12.             float touchDelta = (firstPosition - secondPosition).magnitude;
  13.             float touchDeltaPos = (sPos - fPos).magnitude;
  14.             float deltaDiff = touchDelta - touchDeltaPos;
  15.  
  16.             playerGameCamera.transform.position = new Vector3();
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement