🌟VR基本設定
🌠空間設定
因為空間不大,所以選擇僅站立即可
當偵測到頭戴式顯示器及手把,就可以按下一步將頭戴式顯示器拿在胸前,校準中心點的位置
將頭戴式顯示器放置在地上,或是放在桌上並測量桌子高度,校準完成後即可按下一步
完成空間設定
🌠Room Overview
可以看到基地台偵測範圍以及自己的所在位置
點擊SteamVR→Settings
選擇Developer,並下拉找到Room Overview開啟Room Overview
🌠用電腦觀看VR畫面
點擊SteamVR→Display Mirror
可看到左右鏡片所投影的景象,若戴上VR,就能夠看到疊合後的畫面🌟在Steam下載遊戲試玩
🌠COSMIC SUGAR
🌠Endless Night
🌠Rain Shine
🌟實作練習
🌠Homework_1
在Asset Store搜尋SteamVR的套件,下載並匯入備用
將CameraRig拉進場景中新增一個C#腳本
程式碼內容如下:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Collections.Generic;
using UnityEngine;
public class ShowText : MonoBehaviour {
public SteamVR_TrackedObject leftController;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (leftController == null || leftController.index == SteamVR_TrackedObject.EIndex.None)
return;
public SteamVR_TrackedObject leftController;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (leftController == null || leftController.index == SteamVR_TrackedObject.EIndex.None)
return;
//如果沒有偵測到左手手把,就return,直到找到才會繼續往下做
var device = SteamVR_Controller.Input((int)leftController.index);
if (device.GetPressDown(SteamVR_Controller.ButtonMask.Trigger))
//如果按下Trigger鍵
{
print("Press Trigger");
}
}
}
var device = SteamVR_Controller.Input((int)leftController.index);
if (device.GetPressDown(SteamVR_Controller.ButtonMask.Trigger))
//如果按下Trigger鍵
{
print("Press Trigger");
}
}
}
將腳本套用至新增的空物件,並將公開變數對應的物件拉進去
按下執行鍵,執行結果如下:放開Trigger
按下Trigger























沒有留言:
張貼留言