OVRCameraRig/TrackingSpace/CenterEyeAnchor
のrotationを取得すればいい。
var centerEyeAnchor = GameObject.Find("CenterEyeAnchor");
Debug.Log (centerEyeAnchor.transform.rotation);
var centerEyeAnchor = GameObject.Find("CenterEyeAnchor");
Debug.Log (centerEyeAnchor.transform.rotation);
Input.GetMouseButton
Input.mousePosition
Input.GetMouseButtonDownタッチの終了を取得するには
Input.GetMouseButtonUpを利用します。
Input.GetKey(KeyCode.Escape)
using UnityEngine;
using System.Collections;
public class Main : MonoBehaviour {
// Use this for initialization
void Start () {
Debug.Log ("GearVR test");
Debug.Log ("ScreenSize:" + Screen.width + "," + Screen.height);
}
// Update is called once per frame
void Update () {
if(Input.GetMouseButton(0)){
var mousePos = Input.mousePosition;
Debug.Log ("mouse down:" + mousePos);
}
if(Input.GetMouseButtonUp(0)){
var mousePos = Input.mousePosition;
Debug.Log ("mouse up" + mousePos);
}
if (Input.GetKey(KeyCode.Escape)){
Debug.Log ("escape");
}
}
}