From 0b4cb61ad4a4346c3ded53a11f40e67c9b8ab4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E7=9C=8B?= <1918891542@qq.com> Date: Sun, 16 Jul 2023 11:44:17 +0800 Subject: [PATCH] improve progressbar --- .../Gallop/Live/Cutt/LiveTimelineMotionSequence.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineMotionSequence.cs b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineMotionSequence.cs index 219ae2f..eed66f8 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineMotionSequence.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineMotionSequence.cs @@ -33,6 +33,9 @@ namespace Gallop.Live.Cutt private bool _motionSetup = false; + private int _curIndex = -1; + private int _prevIndex = -1; + public void Initialize(Transform target, int targetIndex, int seqDataIndex, LiveTimelineControl timelineControl, List animclips = null) { if(animclips != null) @@ -91,7 +94,6 @@ namespace Gallop.Live.Cutt _tempAnim.Play(_targetAnim.name); _motionSetup = true; } - } return; } @@ -100,7 +102,9 @@ namespace Gallop.Live.Cutt { LiveTimelineKeyIndex curKey = LiveTimelineControl.AlterUpdate_Key(_currentKey, currentTime); - if (curKey != null && curKey.index != -1) + _curIndex = curKey.index; + + if ((curKey != null && _curIndex != -1 && _curIndex != _prevIndex) || Director.instance.sliderControl.is_Touched || Director.instance._syncTime == false) { LiveTimelineKeyCharaMotionData arg = curKey.key as LiveTimelineKeyCharaMotionData; @@ -111,6 +115,8 @@ namespace Gallop.Live.Cutt _tempAnim[anim.name].time = (float)(start + interval); _tempAnim.Play(anim.name); } + + _prevIndex = _curIndex; } } }