-
VIVE Wave
-
SDK
- VIVE Wave 是什麼?
- 哪裡可以下載 Wave SDK?
- 如何存取 Wave Developer Community 論壇?
- 匯入自訂套件後,如何修正編譯或建置錯誤?
- 如何將控制器放入場景中?
- 如何在同一場景內切換不同的追蹤姿勢設定?
- 如何在同一個場景中切換 6DoF 和 3DoF?
- 為什麼無法接收事件或點按系統重疊?
- 如何在執行階段中取得控制器物件?
- 如何顯示或隱藏控制器指標?
- 如何將控制器模型物件從模型原點 (Root) 更改為發射器起始點 (Emitter)?
- 如何得知控制器是否傳送事件?
- 如何在僅能旋轉 (Rotation-Only) 的環境下設定控制器位置?
- 如何在場景中只顯示一個控制器?
- 如何找出頭部與地板的距離?
-
-
VIVE SRWorks
-
VIVE 眼球和臉部追蹤
-
VIVE 手勢追蹤
-
VIVE 3DSP Audio
-
VIVEPORT
-
VIVE Business 串流
-
臉部追蹤
-
手勢追蹤
-
如何在場景中只顯示一個控制器?
您可以選擇在場景中只顯示一個控制器,但仍保持 2 個使用中的控制器。
新增下列程式碼:
- WaveVR 中的新指令碼。
private GameObject ControllerLoader_DO = null; private GameObject loaderInstance_DO = null; private GameObject ControllerLoader_ND = null; private GameObject loaderInstance_ND = null; #region MonoBehaviour Overrides void OnEnable() { WaveVR_Utils.Event.Listen (WaveVR_Utils.Event.CONTROLLER_MODEL_UNLOADED, OnControllerUnloaded); } void Start () { this.ControllerLoader_DO = Instantiate(Resources.Load("ControllerLoader", typeof(GameObject))) as GameObject; this.ControllerLoader_DO.GetComponent<WaveVR_ControllerLoader>().WhichHand = WaveVR_ControllerLoader.ControllerHand.Dominant; this.ControllerLoader_DO.SetActive(false); this.ControllerLoader_ND = Instantiate(Resources.Load("ControllerLoader", typeof(GameObject))) as GameObject; this.ControllerLoader_ND.GetComponent<WaveVR_ControllerLoader>().WhichHand = WaveVR_ControllerLoader.ControllerHand.Non_Dominant; this.ControllerLoader_ND.SetActive(false); }
- Update () 會監控目前的控制器連線狀態,而且只顯示一個控制器。
void Update () { if (WaveVR.Instance == null|| this.ControllerLoader_DO == null || this.ControllerLoader_ND == null) return; if (this.loaderInstance_DO != null || this.loaderInstance_ND != null) return; WaveVR.Device _dev_do = WaveVR.Instance.getDeviceByType (WaveVR_Controller.EDeviceType.Dominant); if (_dev_do != null && _dev_do.connected && this.loaderInstance_ND == null) { this.loaderInstance_DO = Instantiate(ControllerLoader_DO); this.loaderInstance_DO.SetActive(true); } WaveVR.Device _dev_nd = WaveVR.Instance.getDeviceByType(WaveVR_Controller.EDeviceType.NonDominant); if (_dev_nd != null && _dev_nd.connected && this.loaderInstance_DO == null) { this.loaderInstance_ND = Instantiate(ControllerLoader_ND); this.loaderInstance_ND.SetActive(true); } }
- 當其中一個控制器連線中斷時,LoaderInstance 將會銷毀並設為 null。
void OnDisable() { WaveVR_Utils.Event.Remove (WaveVR_Utils.Event.CONTROLLER_MODEL_UNLOADED, OnControllerUnloaded); } #endregion void OnControllerUnloaded(params object[] args) { WaveVR_Controller.EDeviceType _type = (WaveVR_Controller.EDeviceType)args[0]; switch (_type) { case WaveVR_Controller.EDeviceType.Dominant:if (this.loaderInstance_DO != null) { PrintDebugLog("OnControllerUnloaded() remove DO" + this.loaderInstance_DO.name); this.loaderInstance_DO.SetActive(false); Destroy(this.loaderInstance_DO); this.loaderInstance_DO = null; } break; case WaveVR_Controller.EDeviceType.NonDominant:if (this.loaderInstance_ND != null) { PrintDebugLog("OnControllerUnloaded() remove ND" + this.loaderInstance_ND.name); this.loaderInstance_ND.SetActive(false); Destroy(this.loaderInstance_ND); this.loaderInstance_ND = null; } break; default:break; } }
這對您有幫助嗎?
是
否
送出
感謝您!您的意見回報可協助他人查看最實用的資訊。