unity中怎么让物体位置复位_OculusRift如何复位视图转到初
始位置
如何将Rift转到初始的位置,ResetOrientation可以实现该功能,函数原型:
public static bool ResetOrientation(int sensor)
测试代码如下:
private OVRDevice ovrdevice ; // This is the variable you'll use to reference the OVRDevice script.
void Awake()
{
ovrdevice = GameObject.Find(OVRController).GetComponent() ;
// Here, we reference the script OVRDevice, attached to the gameobject OVRController,
// in our variable ovrdevice.
}
void Update()
{
if (Input.GetKeyDown("left ctrl")) // If the player press left ctrl (listed as an input in Unity in the inputs window)...
{
ovrdevice.ResetOrientation(0);
// ... we call the ResetOrientation() function of the OVRDevice script referenced in our ovrdevice variable.
}variable怎么记
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论