1
我在使用Daydream視圖和控制器測試像素時使用了Daydream支持的Unity技術預覽。在Google Daydream中傳送攝像頭將不起作用
我已經成功地將我的場景部署到我的設備,一切都按預期工作。
但是,對於我的生活,我無法讓相機傳送。我指着地板,可以將其他物體傳送到我指向的地方,但不能傳送到相機。實際上,當我檢查轉換時,相機傳輸很好,但我在Pixel上看到的視圖不會更新。有什麼我必須調用GVRViewer腳本?
下面是相關代碼:
RaycastHit hitInfo;
Vector3 rayDirection = GvrController.Orientation * Vector3.forward;
if (Physics.Raycast(controllerPivot.transform.position, rayDirection, out hitInfo)) {
if (hitInfo.collider && hitInfo.collider.gameObject) {
SetSelectedObject(hitInfo.collider.gameObject);
//Teleport on click
if (selectedObject == floor) {
if (GvrController.ClickButtonDown) {
selectedObject.GetComponent<Renderer>().material = cubeActiveMaterial;
controllerPivot.transform.position = new Vector3 (hitInfo.point.x, controllerPivot.transform.position.y, hitInfo.point.z);
playerCamera.transform.position = new Vector3 (hitInfo.point.x, playerCamera.transform.position.y, hitInfo.point.z);
gvrControllerMain.transform.position = new Vector3 (hitInfo.point.x, gvrControllerMain.transform.position.y, hitInfo.point.z);
}
}
}