fix: 火山表情修复

This commit is contained in:
2026-07-19 23:43:53 +08:00
parent a6d541383b
commit f444978717
8 changed files with 275 additions and 9 deletions
@@ -88,12 +88,14 @@ namespace AibisDream.FrameAnimation
private double frameElapsedSeconds;
private bool hasStarted;
private bool hasCompleted;
private bool hasCompletedFirstTerminalLoopCycle;
public string PlayableId => plan.PlayableId;
public string CurrentClipId => CurrentStep?.Clip != null ? CurrentStep.Clip.Id : string.Empty;
public string CurrentNodeId => CurrentStep?.NodeId ?? string.Empty;
public int CurrentFrameIndex => hasStarted && !hasCompleted ? frameIndex : -1;
public FrameClip CurrentClip => CurrentStep?.Clip;
internal bool HasCompletedFirstTerminalLoopCycle => hasCompletedFirstTerminalLoopCycle;
internal FrameAnimationPlaybackSnapshot Snapshot =>
new FrameAnimationPlaybackSnapshot(
hasStarted,
@@ -129,6 +131,7 @@ namespace AibisDream.FrameAnimation
{
hasStarted = true;
hasCompleted = false;
hasCompletedFirstTerminalLoopCycle = false;
stepIndex = 0;
frameIndex = 0;
frameElapsedSeconds = 0d;
@@ -186,6 +189,7 @@ namespace AibisDream.FrameAnimation
var cycleRealDuration = GetClipDurationSeconds(step.Clip) / effectiveSpeed;
if (cycleRealDuration > Epsilon && remainingRealSeconds >= cycleRealDuration)
{
hasCompletedFirstTerminalLoopCycle = true;
remainingRealSeconds %= cycleRealDuration;
if (remainingRealSeconds <= Epsilon)
{
@@ -247,6 +251,7 @@ namespace AibisDream.FrameAnimation
if (step.TerminalEndBehavior == FrameClipEndBehavior.Loop)
{
hasCompletedFirstTerminalLoopCycle = true;
frameIndex = 0;
ApplyCurrentFrame(applySprite);
return FrameAnimationSessionEvaluation.Running;