private void Update() { if (!_isAlive) { _face = Dead; } else if (_isFiring) { _face = Fire; } else if (_isZoomed) { _face = Zoom; } else { _face = Default; } var d = 8; Util.Lerp(ref _interpolatedFace.A, _face.A, d); Util.Lerp(ref _interpolatedFace.Angry, _face.Angry, d); Util.Lerp(ref _interpolatedFace.CloseEyes, _face.CloseEyes, d); Util.Lerp(ref _interpolatedFace.E, _face.E, d); Util.Lerp(ref _interpolatedFace.M, _face.M, d); Util.Lerp(ref _interpolatedFace.Aim, _face.Aim, d); Util.Lerp(ref _interpolatedFace.AngryMouth, _face.AngryMouth, d); Util.Lerp(ref _interpolatedFace.Happy, _face.Happy, d); Util.Lerp(ref _interpolatedFace.HappyEyes, _face.HappyEyes, d); Util.Lerp(ref _interpolatedFace.O, _face.O, d); if (Mesh == null) { return; } var renderer = Mesh.GetComponent <SkinnedMeshRenderer>(); if (renderer == null) { return; } renderer.SetBlendShapeWeight(0, _interpolatedFace.A); renderer.SetBlendShapeWeight(1, _interpolatedFace.Angry); renderer.SetBlendShapeWeight(2, _interpolatedFace.CloseEyes); renderer.SetBlendShapeWeight(3, _interpolatedFace.E); renderer.SetBlendShapeWeight(4, _interpolatedFace.M); renderer.SetBlendShapeWeight(5, _interpolatedFace.Aim); renderer.SetBlendShapeWeight(6, _interpolatedFace.AngryMouth); renderer.SetBlendShapeWeight(7, _interpolatedFace.Happy); renderer.SetBlendShapeWeight(8, _interpolatedFace.HappyEyes); renderer.SetBlendShapeWeight(9, _interpolatedFace.O); }