如何使用 Hololens 2 检测 "long touch" 手势? (Unity3D 与 MRTK)

How can I detect a "long touch" gesture with the Hololens 2? (Unity3D with MRTK)

在我的 Hololens 2 应用程序中,我想为每个全息图添加一个上下文菜单,用户可以通过触摸全息图 2 秒来打开它。它基本上应该是这样的:

https://docs.microsoft.com/en-us/dynamics365/mixed-reality/guides/media/touch-dwell-animation.gif

(来源:https://docs.microsoft.com/en-us/dynamics365/mixed-reality/guides/authoring-gestures-hl2

但是我找不到任何代码示例。您对我需要为此文档或任何文档添加什么有任何想法吗?

Interactable component can meet your request, it will catch input actions and funnel these interactions into events to responsive. To make this possible, the Interactable component provides different types of out-of-box event receivers to respond to different types of input. Among them, InteractableOnHoldReceiver is used to trigger after pressing Interactable for a period. For how to add the event receiver into the Interactable please see Events