问题
In microsoft hololens ,Added cursor to a button but unable add cursor action ,can anyone help Thanks in advance.
回答1:
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
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
}
}
回答2:
Make sure you dont forget to have an event system in your scene.
来源:https://stackoverflow.com/questions/41689958/how-to-add-click-action-to-cursor-in-hololens