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怎么记
}