void Update()
        {
            if (ControllerUser == null)
            {
                return;
            }

            nuitrack.Face currentFace = ControllerUser.Face;

            if (currentFace != null && spawnTransform)
            {
                image.enabled = true;
                infoPanel.SetActive(showInfo);

                Rect screenRect = currentFace.AnchoredRect(spawnTransform.rect, frameTransform);

                frameTransform.sizeDelta        = screenRect.size;
                frameTransform.anchoredPosition = screenRect.position;

                ageText.text    = currentFace.AgeType.ToString();
                yearsText.text  = string.Format("Years: {0:F1}", currentFace.age.years);
                genderText.text = currentFace.Gender.ToString();

                neutral.value  = currentFace.GetEmotionValue(nuitrack.Emotions.Type.neutral);
                angry.value    = currentFace.GetEmotionValue(nuitrack.Emotions.Type.angry);
                surprise.value = currentFace.GetEmotionValue(nuitrack.Emotions.Type.surprise);
                happy.value    = currentFace.GetEmotionValue(nuitrack.Emotions.Type.happy);
            }
            else
            {
                image.enabled = false;
                infoPanel.SetActive(false);
            }
        }
Exemple #2
0
        internal void Reset()
        {
            Skeleton     = null;
            RawUserHands = null;
            RawGesture   = null;
            face         = null;

            RightHand = null;
            LeftHand  = null;
        }
Exemple #3
0
 internal void AddData(nuitrack.Face face)
 {
     this.face = (face != null && face.IsEmpty) ? null : face;
 }