TexeL

Untitled

Jul 6th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. Vector2 v0 = touchesList0[9].position - touchesList0[0].position;
  2.                         Vector2 v1 = touchesList1[9].position - touchesList1[0].position;
  3.  
  4.  
  5.                         if (v0.magnitude > 1 || v1.magnitude > 1)
  6.                         {
  7.                             var angle = Vector2.Angle(v0, v1);
  8.                             var angle2 = GetAngleBetweenTwoVectors(v0, v1);
  9.                             //print(angle);
  10.                             print("==" + angle2);
  11.  
  12.                             if (Mathf.Abs(angle2) < 3f)
  13.                             {
  14.                                 if (Mathf.Sign(v0.y) == Mathf.Sign(v1.y) && Mathf.Abs(v1.y) + Mathf.Abs(v0.y) >= 10)
  15.                                 {
  16.  
  17.                                     // Pitch State
  18.                                     navState = NavigateState.Pitch;
  19.                                     ArtCameraRelativeControl.inst.InitPitchState();
  20.                                     //Debug.LogWarning(navState);
  21.                                 }
  22.                                 else
  23.                                 {
  24.                                     navState = NavigateState.Zoom;
  25.                                     ArtCameraRelativeControl.inst.InitZoomState();
  26.  
  27.                                 }
  28.                             }
  29.                             else
  30.                             {
  31.                                 // Rotate State
  32.                                 navState = NavigateState.RotateMove;
  33.                                 ArtCameraRelativeControl.inst.InitRotateState();
  34.  
  35.                                 //Debug.LogWarning(navState);
  36.                             }
  37.  
  38.                             print(navState);
  39.                         }
Advertisement
Add Comment
Please, Sign In to add comment