Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additive tweens #44

Open
rhys-vdw opened this issue Jul 14, 2022 · 0 comments
Open

Additive tweens #44

rhys-vdw opened this issue Jul 14, 2022 · 0 comments

Comments

@rhys-vdw
Copy link
Owner

rhys-vdw commented Jul 14, 2022

Must be able to get the current position to add to it, even if just adding the current delta. This means that this is not achievable without #23, which I would prefer not to do.

Perhaps there is some hacky way to do it:

static Tween TweenPositionAdditive(this Transform transform, ...) {
  var prev = transform.position;
  Peachy.Tween(
    position,
    to,
    v => {
      var delta = v - prev;
      transform.position += delta;
      prev= v;
    }
  );
}
@rhys-vdw rhys-vdw changed the title Blendable tweens Additive tweens Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant