コード例 #1
0
 public void PoseProcess(NuitrackPose pose, int userID, float compilance)
 {
     if (userID == UserID)
     {
         poseNameText.text    = pose.name;
         poseCompilance.value = compilance;
         fillSlider.color     = Mathf.Approximately(compilance, 1) ? succesPoseColor : defaultFillColor;
     }
 }
コード例 #2
0
        PoseItem CreatePoseItem(NuitrackPose pose)
        {
            float height = poseItemPrefab.GetComponent <RectTransform>().rect.height;

            PoseItem poseItem = Instantiate(poseItemPrefab, posesContent).GetComponent <PoseItem>();

            poseItem.RectTransform.anchoredPosition = new Vector2(0, -height * poseItems.Count);
            poseItem.UseCurrentUserTracker          = UseCurrentUserTracker;

            if (!UseCurrentUserTracker)
            {
                poseItem.UserID = UserID;
            }

            poseItem.Init(pose.name);
            poseItems.Add(poseItem);

            return(poseItem);
        }
コード例 #3
0
        public void AddCustomPose()
        {
            if (ControllerUser != null && ControllerUser.Skeleton != null)
            {
                if (customPose != null)
                {
                    poseDetector.RemoveListener(customPose, customPoseItem.PoseProcess);
                    poseDetector.RemovePose(customPose);

                    DeletePoseItem(customPoseItem);
                }

                customPose     = poseDetector.AddPose(ControllerUser.Skeleton, customPoseName);
                customPoseItem = CreatePoseItem(customPose);

                poseDetector.AddListener(customPose, customPoseItem.PoseProcess);

                Debug.Log("Pose has been added successfully, you can view it in the PoaseDetector.");
            }
            else
            {
                Debug.LogError("User not found. Make sure that the user is in the frame.");
            }
        }