繁体   English   中英

如何使用新的输入系统在 Unity 中找到鼠标 position

[英]How to find the mouse position in Unity using the New Input System

如何在 Unity 中找到鼠标 position? 我正在使用新的输入系统,我已经尝试过

InputDevice mouse = Mouse.current;

Ray ray = camera.ScreenPointToRay(mouse.position);

,但它没有用。 任何人?

用这个:

Ray ray = camera.ScreenPointToRay(Mouse.current.position.ReadValue());

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM