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; } }
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); }
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."); } }