Skip to content

Commit

Permalink
code maintenance.
Browse files Browse the repository at this point in the history
  • Loading branch information
hecomi committed Aug 29, 2022
1 parent 250396f commit 1bcfa6d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Assets/uLipSync/Runtime/uLipSyncBlendShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,20 @@ public class BlendShapeInfo
float _animBakeDeltaTime = 1f / 60;
#endif

void UpdateLipSync()
{
UpdateVolume();
UpdateVowels();
_lipSyncUpdated = false;
}

public void OnLipSyncUpdate(LipSyncInfo info)
{
_info = info;
_lipSyncUpdated = true;
if (updateMethod == UpdateMethod.LipSyncUpdateEvent)
{
UpdateVolume();
UpdateVowels();
_lipSyncUpdated = false;
UpdateLipSync();
OnApplyBlendShapes();
}
}
Expand All @@ -57,9 +62,7 @@ void Update()
#endif
if (updateMethod != UpdateMethod.LipSyncUpdateEvent)
{
UpdateVolume();
UpdateVowels();
_lipSyncUpdated = false;
UpdateLipSync();
}

if (updateMethod == UpdateMethod.Update)
Expand Down Expand Up @@ -205,21 +208,19 @@ public override List<float> GetPropertyWeights()

public override void OnAnimationBakeStart()
{
_lipSyncUpdated = true;
_isAnimationBaking = true;
}

public override void OnAnimationBakeUpdate(LipSyncInfo info, float dt)
{
_info = info;
_animBakeDeltaTime = dt;
UpdateVolume();
UpdateVowels();
_lipSyncUpdated = true;
UpdateLipSync();
}

public override void OnAnimationBakeEnd()
{
_lipSyncUpdated = false;
_isAnimationBaking = false;
}
#endif
Expand Down

0 comments on commit 1bcfa6d

Please sign in to comment.