Open rhys-vdw opened 2 years ago
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();
Generally a way to do this:
But also need some way to Sync after bulk operations: