如何添加注视输入计时器以凝视3秒后触发动作? [英] how to add gaze input timer to trigger an action after gazing for 3secs?
问题描述
我是团结与VR的新手。我一直在使用谷歌纸板SDK来统一创建VR应用,并被困在gazetimer中。我只想在用户查看任何对象3秒钟但无法执行操作时触发操作。请帮助
请在此处查看类似的问题并回答
I am new to unity and VR. I have been using google cardboard SDK to create VR apps in unity and am stuck at gazetimer. I want to trigger an action only if the user looks at any object for 3secs but have not been able to do so. Please help
Please see a similar question and answer here Use Gaze Input duration to select UI text in Google Cardboard
In summary, create a script to time the gaze, by cumulatively adding Time.deltaTime
on each frame when the object is gazed at. When gaze time hits a pre-specified duration, trigger the button's OnClick
event.
On the object, activate the script's gaze timing functions using event triggers Pointer Enter
and Pointer Exit
. See screenshot:
这篇关于如何添加注视输入计时器以凝视3秒后触发动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!