Skip to content

Commit

Permalink
Update demo code
Browse files Browse the repository at this point in the history
  • Loading branch information
Inspiaaa committed Sep 5, 2024
1 parent a07da65 commit 40714ae
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions demo/IconAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ public partial class IconAnimation : Node2D
{
public override void _Ready()
{
Co.Run(DoAnimation());
Co.Run(PlayAnimation());
}

private IEnumerator DoAnimation()
private IEnumerator PlayAnimation()
{
yield return MoveToPosition(new Vector2(0, 0), 2);

Expand All @@ -34,13 +34,10 @@ private IEnumerator DoAnimation()

private CoroutineBase MoveToPosition(Vector2 targetPos, float duration)
{
return Co.Tween(() => {
var tween = CreateTween();
tween
.TweenProperty(this, "position", targetPos, duration)
.SetTrans(Tween.TransitionType.Cubic);
return tween;
});
return Co.Tween(tween => tween
.TweenProperty(this, "position", targetPos, duration)
.SetTrans(Tween.TransitionType.Cubic)
);
}

private IEnumerator FullRotation(float duration)
Expand Down

0 comments on commit 40714ae

Please sign in to comment.