1.下载导入资源:https://pan.baidu.com/s/19JMpg6-_zVFXD6K1UKh_bQ
提取码:7d76
2.拖动Hologram下的Cursor到Hierarchy;
3.新建空物体,并命名为OrigamiCollection;

4.修改相机属性;

5.新建脚本WorldCursor,并添加到Cursor上;
using UnityEngine;
public class WorldCursor : MonoBehaviour
{
private MeshRenderer meshRenderer;
// Use this for initialization
void Start()
{
// Grab the mesh renderer that's on the same object as this script.
meshRenderer = this.gameObject.GetComponentInChildren<MeshRenderer>();
}
// Update is called once per frame
void Update()
{

本文介绍了在Hololens上实现单击和双击手势交互的步骤,包括下载导入资源、设置场景元素、编写脚本等。通过创建WorldCursor和GazeGestureManager脚本处理交互,当立方体被单击变为蓝色,双击则变为红色。最后,文章提供了完整工程的下载链接供测试。
最低0.47元/天 解锁文章
8918





