Skip to content

Commit

Permalink
When starting an animation from a master timeline, ignore preserve lo…
Browse files Browse the repository at this point in the history
…op settings
  • Loading branch information
acidbubbles committed Dec 30, 2020
1 parent a6ed729 commit 056b6b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/AtomAnimations/AtomAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void PlayClips(string animationName, bool sequencing)
PlayClip(clip, sequencing);
}

public void PlayClip(AtomAnimationClip clip, bool sequencing)
public void PlayClip(AtomAnimationClip clip, bool sequencing, bool allowPreserveLoops = true)
{
if (clip.playbackEnabled && clip.playbackMainInLayer) return;
if (!isPlaying)
Expand All @@ -251,10 +251,9 @@ public void PlayClip(AtomAnimationClip clip, bool sequencing)
if (previousMain != null && previousMain != clip)
{
if (previousMain.uninterruptible)
{
return;
}
if (clip.loop && clip.preserveLoops && previousMain.loop)

if (clip.loop && clip.preserveLoops && previousMain.loop && allowPreserveLoops)
{
previousMain.SetNext(clip.animationName, Mathf.Max(previousMain.animationLength - previousMain.clipTime, 0f));
}
Expand Down
2 changes: 1 addition & 1 deletion src/PeerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private void ReceiveMasterClipState(object[] e)
foreach (var clip in GetClips(e))
{
if (clip == null || clip.playbackEnabled) return;
animation.PlayClip(clip, true);
animation.PlayClip(clip, true, false);
}
}

Expand Down

0 comments on commit 056b6b8

Please sign in to comment.