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

Ability to manually update multiple tweens at once by ID #66

Open
rhys-vdw opened this issue Jul 18, 2022 · 1 comment
Open

Ability to manually update multiple tweens at once by ID #66

rhys-vdw opened this issue Jul 18, 2022 · 1 comment

Comments

@rhys-vdw
Copy link
Owner

Generally a way to do this:

Peachy.ManualUpdate(new [] { tweenA, tweenB }, 0.5f);

But also need some way to Sync after bulk operations:

Peachy.KillTargeting(transform).Sync();
@rhys-vdw
Copy link
Owner Author

Thought on Sync:

Peachy.Targeting(transform).Kill().Sync();

Where Targeting returns a TweenTarget struct that has extension methods.

Or alternatively, maybe could do something simpler:

Peachy.KillTarget(transform);
Peachy.SyncTarget(transform);
Peachy.ManualUpdateTarget(transform, 0.5f);

Query thoughts

Could generally have structs that represent an enumerable collection of tweens (either a "query" or a list of Tweens), and these could be used for bulk operations that aren't tied to specific update groups.

So:

Tweens as = Peachy.Tweens(a, b, c);
Tweens bs = Peachy.Targeting(transform);
static Tweens KillTargeting(object target) {
  Tweens tweenss = Targeting(target);
  foreach (var tween in tweens) {
    Kill(t);
  }
  return tweens;
}

// Or more simply:

static Tweens Kill(Tweens tweens) {
  foreach (var t in tweens) Kill(t);
  return tweens;
}

static Tweens Sync(Tweens tweens) {
  _runState.Set(tweens);
  Run();
  return;
}

Peachy.Targeting(transform).Kill().Sync();

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