如何在Hololens中向光标添加点击动作 [英] How to add click action to cursor in hololens
本文介绍了如何在Hololens中向光标添加点击动作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Microsoft hololens中,将光标添加到按钮上,但无法添加光标操作,任何人都可以帮忙 预先感谢.
In microsoft hololens ,Added cursor to a button but unable add cursor action ,can anyone help Thanks in advance.
推荐答案
要添加单击"功能,您可以使用HoloLens工具箱中内置的输入管理器来完成.看到这里:
To add the ability to "click" you can do this with the Input Manager that is built into the HoloLens Toolkit. See here:
https://github.com/Microsoft/HoloToolkit- Unity/tree/master/Assets/HoloToolkit/Input
具体来说,您应该将InputManager预制添加到场景中,然后将IInputClickHandler的实现添加到附加到对象的脚本中.像这样:
Specifically you should add the InputManager prefab to your scene, then add to a script that is attached to an object an implementation of IInputClickHandler. So something like this:
public class DoSomethingOnClick : MonoBehaviour, IInputClickHandler
{
void IInputClickHandler.OnInputClicked(InputEventData eventData)
{
// A Click happened here, do something about it
}
}
这篇关于如何在Hololens中向光标添加点击动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文