private void MoveBrowFromEye(EyeBrow brow, EyeTarget eye) { float yPosition = 0; float eyeAngleX = Humanoid.Tracking.Angle.Normalize(eye.target.transform.localEulerAngles.x); if (eyeAngleX < 0) { yPosition = -eyeAngleX * 0.0004F; } if (brow.outer.isPresent) { brow.outer.target.transform.localPosition = brow.outer.startPosition + Vector3.up * yPosition; brow.outer.target.confidence.position = 0.1F; } if (brow.center.isPresent) { brow.center.target.transform.localPosition = brow.center.startPosition + Vector3.up * yPosition; brow.center.target.confidence.position = 0.1F; } if (brow.inner.isPresent) { brow.inner.target.transform.localPosition = brow.inner.startPosition + Vector3.up * yPosition; brow.inner.target.confidence.position = 0.1F; } }
private void InstantiateEyeBrows(string currentKey, out int eyeBrowColor, out int eyeBrowType) { EyeBrow eyeBrow = eyeBrowDictionary[currentKey]; _eyeBrowInstance = Instantiate(_eyeBrowPrefab, eyeBrow.EyeBrowPosition, Quaternion.identity); _eyeBrowInstanceKey = currentKey; _eyeBrowInstance.name = _eyeBrowInstanceKey; _eyeBrowInstance.GetComponent <SpriteRenderer>().sprite = eyeBrow.EyeBrowSprite; string[] words = _eyeBrowInstanceKey.Split('_'); string eyeBrowTypeValue = ""; // Get the eyeBrowTypeValue from the _eyeBrowInstanceKey if (words.Length == 2) { eyeBrowTypeValue = words[1]; } currentKey = GenerateInvertedEyeBrowKey(eyeBrow.EyeBrowObjectColor, eyeBrowTypeValue); eyeBrow = invertedEyeBrowDictionary[currentKey]; _invertedEyeBrowInstance = Instantiate(_eyeBrowPrefab, eyeBrow.EyeBrowPosition, Quaternion.Euler(_invertRotation)); _invertedEyeBrowInstance.name = currentKey; _invertedEyeBrowInstance.GetComponent <SpriteRenderer>().sprite = eyeBrow.EyeBrowSprite; eyeBrowColor = (int)eyeBrow.EyeBrowObjectColor; eyeBrowType = int.Parse(eyeBrowTypeValue); }
private void UpdateEyeBrow(FaceTarget faceTarget, EyeBrow brow, EyeTarget eye) { UpdateFacePoint(faceTarget, brow.outer); UpdateFacePoint(faceTarget, brow.center); UpdateFacePoint(faceTarget, brow.inner); }