From 66ce882ebbdc76a62ef5ecfccf2dde2c38395770 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 5 Mar 2025 09:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9timeline=20=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Actions/TimeLineAction.cs | 27 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Actions/TimeLineAction.cs b/Assets/Scripts/Actions/TimeLineAction.cs index 1ba467fd..817604e0 100644 --- a/Assets/Scripts/Actions/TimeLineAction.cs +++ b/Assets/Scripts/Actions/TimeLineAction.cs @@ -64,6 +64,7 @@ public class TimeLineAction : IAction { play.Stop(); play.time = curEndFrame / 24; + play.Evaluate(); } if (play.state != PlayState.Playing) { @@ -109,17 +110,31 @@ public class TimeLineAction : IAction { curSpeed = 1; } - if (!play.playableGraph.IsValid()) - { - play.RebuildGraph(); - } - play.playableGraph.GetRootPlayable(0).SetSpeed(curSpeed); - play.Play(); + if (string.IsNullOrEmpty(endFrame) == false) { float.TryParse(endFrame, out curEndFrame); } + + if (!play.playableGraph.IsValid()) + { + play.RebuildGraph(); + } + if (curFrame == curEndFrame) + { + play.time = curEndFrame / 24; + play.Evaluate(); + Finished(); + } + else + { + + play.playableGraph.GetRootPlayable(0).SetSpeed(curSpeed); + play.Play(); + } + + bool iswait = true; bool.TryParse(isWait, out iswait); if (iswait == false)