From 82d747395a984ecc23a4796f9dd2ab8903d0004b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E7=9C=8B?= <1918891542@qq.com> Date: Tue, 25 Jul 2023 22:54:47 +0800 Subject: [PATCH] minor bug fix --- .../Gallop/Live/Cutt/LiveTimelineControl.cs | 4 ++-- .../Gallop/Live/Cutt/LiveTimelineMotionSequence.cs | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineControl.cs b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineControl.cs index fc92f33..9a608ce 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineControl.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineControl.cs @@ -541,10 +541,10 @@ namespace Gallop.Live.Cutt if(nextKey != null && nextKey.interpolateType != LiveCameraInterpolateType.None) { float ratio = CalculateInterpolationValue(curKey, nextKey, time * 60); - chara.transform.position = Vector3.Slerp(curKey.Position, nextKey.Position, ratio); + chara.transform.position = Vector3.Lerp(curKey.Position, nextKey.Position, ratio); var x = chara.Position.localEulerAngles.x; var z = chara.Position.localEulerAngles.z; - chara.Position.localEulerAngles = Vector3.Slerp(new Vector3(x, curKey.LocalRotationY, z), new Vector3(x, nextKey.LocalRotationY, z), ratio); + chara.Position.localEulerAngles = new Vector3(x, Mathf.Lerp(curKey.LocalRotationY, nextKey.LocalRotationY, ratio), z); } else { diff --git a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineMotionSequence.cs b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineMotionSequence.cs index eed66f8..8df4a87 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineMotionSequence.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineMotionSequence.cs @@ -36,6 +36,8 @@ namespace Gallop.Live.Cutt private int _curIndex = -1; private int _prevIndex = -1; + public int charaIndex = -1; + public void Initialize(Transform target, int targetIndex, int seqDataIndex, LiveTimelineControl timelineControl, List animclips = null) { if(animclips != null) @@ -53,6 +55,8 @@ namespace Gallop.Live.Cutt _tempTarget = target; _targetIndex = targetIndex; + charaIndex = targetIndex; + _keyArray = timelineControl._keyArray; if (seqDataIndex < _keyArray.Length) @@ -109,7 +113,15 @@ namespace Gallop.Live.Cutt LiveTimelineKeyCharaMotionData arg = curKey.key as LiveTimelineKeyCharaMotionData; AnimationClip anim = arg.clip; - double start = (double)arg.motionHeadFrame / 60; + double start; + if(arg.isMotionHeadFrameAll) + { + start = (double)arg.motionHeadFrame / 60; + } + else + { + start = (double)arg.motionHeadFrameSeparetes[charaIndex] / 60; + } double interval = currentTime - (double)arg.frame / 60; _tempAnim[anim.name].time = (float)(start + interval);