我有一些Unity场景与之前版本的SteamVR插件运行良好,因为有一个新版本的插件"SteamVR Unity Plugin 2.0"我的代码不再有效.
https://steamcommunity.com/games/250820/announcements/detail/1696059027982397407
如文档所述,我在导入新文件夹之前删除了"SteamVR"文件夹.
但我得到这个错误:
error CS0246: The type or namespace name `SteamVR_Controller' could not be found. Are you missing an assembly reference?
error CS0246: The type or namespace name `SteamVR_TrackedController' could not be found. Are you missing an assembly reference?
Run Code Online (Sandbox Code Playgroud)
所以我可以看到这些类已被弃用:
private SteamVR_Controller.Device device;
private SteamVR_TrackedController controller;
controller = GetComponent<SteamVR_TrackedController>();
Run Code Online (Sandbox Code Playgroud)
使用SteamVR 2.0插件通过代码获取输入的新方法是什么?