3using System.Collections;
15 #if ((UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR)
18 int touchCount = Input.touchCount;
23 Touch t = Input.GetTouch(0);
24 if(EventSystem.current.IsPointerOverGameObject(t.fingerId))
return;
28 case TouchPhase.Moved:
30 float xAngle = t.deltaPosition.y *
Speed;
31 float yAngle = -t.deltaPosition.x *
Speed;
34 Cube.transform.Rotate(xAngle, yAngle, zAngle, Space.World);
43 if (Input.GetMouseButton (0)) {
44 if (EventSystem.current.IsPointerOverGameObject ())
47 float xAngle = Input.GetAxis (
"Mouse Y") *
Speed * 80;
48 float yAngle = -Input.GetAxis (
"Mouse X") *
Speed * 80;
51 Cube.transform.Rotate (xAngle, yAngle, zAngle, Space.World);