2.首先先下載好visual stdio code
3.要在unity裡面下載steamvr pluging
4.然後把camerarig拉到hierarchy
5.到window下載steamvr input設定手把按鈕,會跳到網頁作設定(chrome比較好)
6.寫程式碼(好像是手把的問題,是很多次沒有成功)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;//自己寫的
public class mycode : MonoBehaviour
{
public SteamVR_Action_Boolean trigger;///按下按鈕出現數值
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (trigger.GetState(SteamVR_Input_Sources.Any)){
print("yes");///當手把按下按鈕出現yes
}
}
}
7.
沒有留言:
張貼留言