We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac3ae83 commit c068ce6Copy full SHA for c068ce6
1 file changed
Assets/Scripts/Camera/EditorCardboardCamera.cs
@@ -0,0 +1,23 @@
1
+using System.Collections;
2
+using System.Collections.Generic;
3
+using UnityEngine;
4
+
5
+// editor only Google Carboard VR cam simulation with left alt + mouse
6
7
+public class EditorCardboardCamera : MonoBehaviour
8
+{
9
+#if UNITY_EDITOR
10
+ Vector2 rotation = Vector2.zero;
11
+ public float speed = 3;
12
13
+ void Update()
14
+ {
15
+ if (Input.GetKey(KeyCode.LeftAlt))
16
17
+ rotation.y += Input.GetAxis("Mouse X");
18
+ rotation.x += -Input.GetAxis("Mouse Y");
19
+ transform.eulerAngles = (Vector2)rotation * speed;
20
+ }
21
22
+#endif
23
+}
0 commit comments