public class CustomLipsMorphBlendShapeJapaneseAIUEOWithExtra : ICriLipsMorph {
~~~
public int extraBlendShapeIndex;
~~~
public void Update(ref CriLipsMouth.Info info, ref CriLipsMouth.MorphTargetBlendAmountAsJapanese blendAmount) {
~~~
Target.SetBlendShapeWeight(extraBlendShapeIndex, this.volume + 96.0f);
}
}
本クラスを実行中に生成し、キャラクターモデルごとの設定を行っています。private void SetupComponent() {
customLipsMorph = new CustomLipsMorphBlendShapeJapaneseAIUEOWithExtra();
なお、 CustomLipsMorphBlendShapeJapaneseAIUEOWithExtra クラスはブレンドシェイプのインデックス値をもとにモーフィングを行うため customLipsMorph.Target = skinnedMeshRenderer;
customLipsMorph.aIndex
= skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("MOUTH_A");
customLipsMorph.iIndex
= skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("MOUTH_I");
customLipsMorph.uIndex
= skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("MOUTH_U");
customLipsMorph.eIndex
= skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("MOUTH_E");
customLipsMorph.oIndex
= skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("MOUTH_O");
customLipsMorph.extraBlendShapeIndex
= skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("BROW_FUN");
}