[英]Utilizing the touchpad on gearVR in Unity
Still learning here and starting of with basics (just a plain Plane and moving as the first person around) However i can run the app and look around and up and down etc. but can;t make the camera move when touching the touchpad on the GearVR headset. 仍然在这里学习和开始基础知识(只是一个普通的平面,并作为第一个人移动)但是我可以运行应用程序,环顾四周,上下等但可以;当触摸触摸板时,使相机移动GearVR耳机。
I have created the script (c#) and attached to the camera in unity: 我已创建脚本(c#)并以统一方式连接到相机:
using UnityEngine;
using System.Collections;
public class Moving : MonoBehaviour {
// Use this for initialization
void Start()
{
if (Input.GetButton("Tap"))
{
// Do something if tap starts
}
if (Input.GetButtonUp("Tap"))
{
// Do something if tap ends
}
}
// Update is called once per frame
void Update () {
if (Input.GetButton("Tap"))
{
// Do something if tap starts
}
if (Input.GetButtonUp("Tap"))
{
// Do something if tap ends
}
}
}
But it still doesn't seem to work. 但它似乎仍然没有用。 When i build and run the app it does nothing :-(
当我构建并运行应用程序时它什么都不做:-(
I know i am doing something wrong but not sure what. 我知道我做错了什么但不确定是什么。
Handling Single Tap in Oculus Gear VR: 在Oculus Gear VR中处理单击:
void Start()
{
OVRTouchpad.Create();
OVRTouchpad.TouchHandler += OVRTouchpad_TouchHandler;
}
void OVRTouchpad_TouchHandler (object sender, System.EventArgs e)
{
OVRTouchpad.TouchArgs touchArgs = (OVRTouchpad.TouchArgs)e;
OVRTouchpad.TouchEvent touchEvent = touchArgs.TouchType;
if(touchArgs.TouchType == OVRTouchpad.TouchEvent.SingleTap)
{
// Your response to Tap goes here.
}
}
Tap and Hold to Move: 点击并按住移动:
Tap
key in your input following this tutorial. Tap
键。 here are some useful links: 这里有一些有用的链接:
http://forum.unity3d.com/threads/gear-vr-touchpad-fps-script.373103/ http://forum.unity3d.com/threads/gear-vr-touchpad-fps-script.373103/
http://rifty-business.blogspot.co.uk/2014/04/unity-pro-4-using-ovrcameracontroller.html http://rifty-business.blogspot.co.uk/2014/04/unity-pro-4-using-ovrcameracontroller.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.