split the animations namespace into two nuget packages

This commit is contained in:
Dylan Wilson
2017-03-14 21:53:19 +10:00
parent 825a68eaca
commit dbfe2ea32c
40 changed files with 375 additions and 36 deletions
@@ -0,0 +1,27 @@
using System;
namespace MonoGame.Extended.Tweening
{
public class TweenChain<T> : TweenAnimation<T>
{
private int _currentTweenIndex;
public TweenChain(T target, Action onCompleteAction = null, bool disposeOnComplete = true)
: base(target, onCompleteAction, disposeOnComplete)
{
_currentTweenIndex = 0;
}
protected override bool OnUpdate(float deltaTime)
{
var currentTween = Tweens[_currentTweenIndex];
currentTween.Update(deltaTime);
if (currentTween.IsComplete)
_currentTweenIndex++;
return _currentTweenIndex >= Tweens.Count;
}
}
}