public virtual void ShowViseme(SkinnedMeshRenderer renderer, int speed, int overallIntensity)
 {
     currentBlendShapeIndex  = BlendShapeInfo.GetBlendShapeIndex(this);
     currentBlendShapeWeight = renderer.GetBlendShapeWeight(currentBlendShapeIndex);
     if (IsBlendShapeInRange(renderer, speed, overallIntensity))
     {
         IncreaseBlendShapeValue(renderer, speed, overallIntensity);
     }
 }
Beispiel #2
0
 public override void ShowViseme(SkinnedMeshRenderer skinnedMeshRenderer, int incrementationSpeed, int overallIntensity)
 {
     for (int i = 0; i < visemes.Length; i++)
     {
         currentVisemeBlendShapeIndex = BlendShapeInfo.GetBlendShapeIndex(visemes[i]);
         if (skinnedMeshRenderer.GetBlendShapeWeight(currentVisemeBlendShapeIndex) + (Time.deltaTime * incrementationSpeed * visemes[i].pronunciationSpeed) <= overallIntensity * visemes[i].intensity)
         {
             skinnedMeshRenderer.SetBlendShapeWeight(currentVisemeBlendShapeIndex, skinnedMeshRenderer.GetBlendShapeWeight(currentVisemeBlendShapeIndex) + (Time.deltaTime * incrementationSpeed * visemes[i].pronunciationSpeed));
         }
     }
 }