Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector2 v0 = touchesList0[9].position - touchesList0[0].position;
- Vector2 v1 = touchesList1[9].position - touchesList1[0].position;
- if (v0.magnitude > 1 || v1.magnitude > 1)
- {
- var angle = Vector2.Angle(v0, v1);
- var angle2 = GetAngleBetweenTwoVectors(v0, v1);
- //print(angle);
- print("==" + angle2);
- if (Mathf.Abs(angle2) < 3f)
- {
- if (Mathf.Sign(v0.y) == Mathf.Sign(v1.y) && Mathf.Abs(v1.y) + Mathf.Abs(v0.y) >= 10)
- {
- // Pitch State
- navState = NavigateState.Pitch;
- ArtCameraRelativeControl.inst.InitPitchState();
- //Debug.LogWarning(navState);
- }
- else
- {
- navState = NavigateState.Zoom;
- ArtCameraRelativeControl.inst.InitZoomState();
- }
- }
- else
- {
- // Rotate State
- navState = NavigateState.RotateMove;
- ArtCameraRelativeControl.inst.InitRotateState();
- //Debug.LogWarning(navState);
- }
- print(navState);
- }
Advertisement
Add Comment
Please, Sign In to add comment