前端怎么做自己的博客网站,网站建设的主要流程,做网站去哪里好,网站开发前台 后台技术之前就玩过 Manomotion #xff0c;现在有新需求#xff0c;重新接入发现不能用了#xff0c;不管什么办法#xff0c;都识别不了手势#xff0c;我记得当初是直接调用就可以的。
经过研究发现#xff0c;新版本SDK改了写法。下边就写一下新版本的调用#xff0c;并且实…之前就玩过 Manomotion 现在有新需求重新接入发现不能用了不管什么办法都识别不了手势我记得当初是直接调用就可以的。
经过研究发现新版本SDK改了写法。下边就写一下新版本的调用并且实现一个简单的工具脚本。初学者可以参考一下。 主要步骤包含
1.官网注册
2.创建APP
3.获得APIKey
4.下在SDK导入项目
5.测试使用。
工具脚本如下 using UnityEngine; public class ManoHandDetection : MonoBehaviour
{private bool pick false;public bool isPick{get{if (pick){pick false;return true;}return false;}}private bool drop false;public bool isDrop{get{if (drop){drop false;return true;}return false;}}private bool click false;public bool isClick{get{if (click){click false;return true;}return false;}}private void Start(){ManomotionManager.Instance.ShouldCalculateGestures(true);}// Update is called once per framevoid Update(){GestureInfo gestureInfo ManomotionManager.Instance.Hand_infos[0].hand_info.gesture_info;DetectionGestureInfo(gestureInfo);}private void DetectionGestureInfo(GestureInfo gestureInfo){if (gestureInfo.mano_gesture_trigger ! ManoGestureTrigger.NO_GESTURE){switch (gestureInfo.mano_gesture_trigger){case ManoGestureTrigger.DROP:drop true;break;case ManoGestureTrigger.PICK:pick true;break;}}}public Vector3 Get_PalmPos(){return ManomotionManager.Instance.Hand_infos[0].hand_info.tracking_info.palm_center;}public Vector3 Get_POI(){return ManomotionManager.Instance.Hand_infos[0].hand_info.tracking_info.poi;}
}需要注意的是
1.新版SDK 需要在Start调用一次Gesture 功能打开开关。 ManomotionManager.Instance.ShouldCalculateGestures(true);
这个开关可以动态打开、关闭。
2.包名要和Manomotion官网保持一致。
3.Key填写的位置ManomotionManager.cs 脚本上。