Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update () {
- // if (Input.GetMouseButton(0) && sliderRect.Contains (Input.mousePosition)) {
- // Debug.Log ("Over GUI");
- // } else {
- // Debug.Log ("NOT Over GUI");
- if (Input.GetMouseButtonDown(0)) {
- previousMousePos = Input.mousePosition;
- } else {
- deltaPos = Vector3.zero;
- }
- if (Input.GetMouseButton(0)) {
- deltaPos = Input.mousePosition - previousMousePos;
- previousMousePos = Input.mousePosition;
- Vector3 newRotation = Vector3.zero;
- newRotation.x = -deltaPos.y * sensitivity;
- newRotation.y = -deltaPos.x * sensitivity;
- thisTransform.Rotate (newRotation, Space.World);
- }
- // }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement