From ed6b06838050e6c4b6380d9f3636b2b99eaf19fd Mon Sep 17 00:00:00 2001 From: CroakFang <1605296300@qq.com> Date: Sun, 15 Jan 2023 21:17:43 +0800 Subject: [PATCH] add general facial animations support --- Assets/Scripts/UmaViewerBuilder.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index 5badf99..ee4e51f 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -1217,6 +1217,13 @@ public class UmaViewerBuilder : MonoBehaviour CurrentUMAContainer.SetHeight(-1); SetPreviewCamera(null); + //Some animations have facial animation + var facialMotion = Main.AbMotions.FirstOrDefault(a => a.Name.EndsWith(clip.name + "_face")); + if (facialMotion != null) + { + RecursiveLoadAsset(facialMotion); + } + CurrentUMAContainer.UmaAnimator.Play("motion_1", 0, lastTime); CurrentUMAContainer.UmaAnimator.SetTrigger("next"); }