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;
- //float deltaY0 = touchesList0[9].position.y - touchesList0[0].position.y
- if (v0.magnitude > 1 || v1.magnitude > 1)
- {
- var angle = Vector2.Angle(v0, v1);
- var angle2 = GetAngleBetweenTwoVectors(v0, v1);
- //print(angle);
- if (Mathf.Sign(v0.y) == Mathf.Sign(v1.y) && Mathf.Abs(v1.y - v0.y) < 8f)
- {
- // Pitch State
- navState = NavigateState.Pitch;
- ArtCameraRelativeControl.inst.InitPitchState();
- print("angle " + angle2);
- print("Abs Delta y" + Mathf.Abs(v1.y - v0.y));
- print("Dot " + Vector2.Dot(v0.normalized, v1.normalized));
- print(navState);
- //Debug.LogWarning(navState);
- }
- if (Mathf.Abs(angle2) < 3.4f && Vector2.Dot(v0.normalized, v1.normalized) < -0.8f)
- {
- navState = NavigateState.Zoom;
- ArtCameraRelativeControl.inst.InitZoomState();
- print("angle " + angle2);
- print("Abs Delta y" + Mathf.Abs(v1.y - v0.y));
- print("Dot " + Vector2.Dot(v0.normalized, v1.normalized));
- print(navState);
- }
- if (Mathf.Abs(angle2) > 3.2f && (Vector2.Dot(v0.normalized, v1.normalized) < -0.8f))
- {
- // Rotate State
- navState = NavigateState.RotateMove;
- ArtCameraRelativeControl.inst.InitRotateState();
- print("angle " + angle2);
- print("Abs Delta y" + Mathf.Abs(v1.y - v0.y));
- print("Dot " + Vector2.Dot(v0.normalized, v1.normalized));
- print(navState);
- //Debug.LogWarning(navState);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment