From 61a7ffb6bbae47b9f5443f8372900684c473693d Mon Sep 17 00:00:00 2001 From: CroakFang <1605296300@qq.com> Date: Sun, 6 Nov 2022 18:43:25 +0800 Subject: [PATCH] bug fix --- Assets/Scenes/Version2.unity | 2 +- Assets/Scripts/UmaViewerBuilder.cs | 8 ++++---- Assets/Scripts/UmaViewerUI.cs | 13 ++++++++----- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Assets/Scenes/Version2.unity b/Assets/Scenes/Version2.unity index 1ab55c0..5728618 100644 --- a/Assets/Scenes/Version2.unity +++ b/Assets/Scenes/Version2.unity @@ -21966,7 +21966,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1882365343} m_HandleRect: {fileID: 1882365342} m_Direction: 2 - m_Value: 1 + m_Value: 0 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index 26db9e2..0f79adc 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -977,7 +977,6 @@ public class UmaViewerBuilder : MonoBehaviour else if (clip.name.Contains("face")) { if (CurrentUMAContainer.IsMini) return; - CurrentUMAContainer.FaceDrivenKeyTarget.ResetLocator(); CurrentUMAContainer.FaceOverrideController["clip_1"] = clip; CurrentUMAContainer.isAnimatorControl = true; @@ -985,13 +984,15 @@ public class UmaViewerBuilder : MonoBehaviour } else if (clip.name.Contains("ear")) { + if (CurrentUMAContainer.IsMini) return; CurrentUMAContainer.FaceOverrideController["clip_2"] = clip; CurrentUMAContainer.UmaFaceAnimator.Play("motion_1", 1, 0); } else if (clip.name.Contains("pos")) { + if (CurrentUMAContainer.IsMini) return; CurrentUMAContainer.OverrideController["clip_p"] = clip; - CurrentUMAContainer.UmaFaceAnimator.Play("motion_1", 1, 0); + CurrentUMAContainer.UmaFaceAnimator.Play("motion_1", 2, 0); } else if (clip.name.Contains("cam")) { @@ -1030,8 +1031,7 @@ public class UmaViewerBuilder : MonoBehaviour if (posMotion != null) { - Debug.Log("Has Pos!"); - RecursiveLoadAsset(posMotion); + RecursiveLoadAsset(posMotion); } if (CurrentUMAContainer.IsMini) diff --git a/Assets/Scripts/UmaViewerUI.cs b/Assets/Scripts/UmaViewerUI.cs index b392fa9..9f97aab 100644 --- a/Assets/Scripts/UmaViewerUI.cs +++ b/Assets/Scripts/UmaViewerUI.cs @@ -576,8 +576,9 @@ public class UmaViewerUI : MonoBehaviour AnimationSlider.SetValueWithoutNotify(0); // Reset settings by Panel Builder.CurrentUMAContainer.UmaAnimator.speed = AnimationSpeedSlider.value; - if(Builder.CurrentUMAContainer.UmaFaceAnimator) - Builder.CurrentUMAContainer.UmaFaceAnimator.speed = AnimationSpeedSlider.value; + Builder.PreviewCameraAnimator.speed = AnimationSpeedSlider.value; + if (Builder.CurrentUMAContainer.UmaFaceAnimator) + Builder.CurrentUMAContainer.UmaFaceAnimator.speed = AnimationSpeedSlider.value; } /// Toggles one object ON and all others from UI.TogglablePanels list OFF @@ -713,7 +714,8 @@ public class UmaViewerUI : MonoBehaviour else { animator.speed = AnimationSpeedSlider.value; - animator.Play(0, -1, 0); + animator.Play(0, 0, 0); + animator.Play(0, 2, 0); animator_cam.speed = AnimationSpeedSlider.value; animator_cam.Play(0, -1, 0); if (animator_face) @@ -729,7 +731,7 @@ public class UmaViewerUI : MonoBehaviour public void AnimationProgressChange(float val) { - if (!Builder.CurrentUMAContainer || !Builder.CurrentUMAContainer.UmaAnimator) return; + if (!Builder.CurrentUMAContainer) return; var animator = Builder.CurrentUMAContainer.UmaAnimator; var animator_face = Builder.CurrentUMAContainer.UmaFaceAnimator; var animator_cam = Builder.PreviewCameraAnimator; @@ -739,7 +741,8 @@ public class UmaViewerUI : MonoBehaviour // Pause and Seek; animator.speed = 0; - animator.Play(0, -1, val); + animator.Play(0, 0, val); + animator.Play(0, 2, val); animator_cam.speed = 0; animator_cam.Play(0, -1, val); if (animator_face)