一、Pico台式机串流; Android开发参考官方文档
在PC端安装SteamVR和官网的串流助手,在Pico里开启串流助手。
无线串流使用5G网络且在同一个路由器下。
Unity项目需按以下进行配置:
1、在Package Manager界面添加OpenXR Plugin、XR Interaction Toolkit、XR Plugin Management三个插件
2、XR Plugin Management,勾选OpenXR。
3、配置OpenXR,XR Plugin Management下选择OpenXR,配置Profiles,并把Render Mode改为Multi Pass,交互配置选择Oculus Touch
二、后处理无效
Bloom无效,URP需要在相机属性面板设置开启后处理。
三、添加指定版本的XR插件XR Interaction Toolkit 2.3.2版本示例比较全面
导入示例和模拟器:
四、新输入系统
输入事件:
右键-Create InputActions
[SerializeField]
private InputActionReference moveInput;//绑定PlayerMove/Move
// Start is called before the first frame update
void Start()
{
//InputAction move = moveInput.action;
PlayerInput playerInput = GetComponent<PlayerInput>();
InputAction hit = playerInput.actions["TriggerPress"];
InputAction move = playerInput.actions["PadPress"];
// 手动注册回调函数
hit.started += TriggerPressDown;
hit.canceled += TriggerPressUp;
move.started += OnMoveStarted;
}
// Update is called once per frame
void Update()
{
}
void TriggerPressDown(InputAction.CallbackContext context)
{
var v = context.ReadValue<float>();
Debug.Log(string.Format("Fire Started:{0}", v));
}
void TriggerPressUp(InputAction.CallbackContext context)
{
var v = context.ReadValue<float>();
Debug.Log(string.Format("Fire Started:{0}", v));
}
void OnMoveStarted(InputAction.CallbackContext context)
{
var v = context.ReadValue<Vector2>();
Debug.Log(string.Format("Move Started:{0}", v));
}