9 public partial class Fiber {
12 AddAction(_ => FrameWorker.Instance.Load(fiber:
this, data: Time.frameCount + framesToSkip));
15 public Fiber
SkipFrames(Func<Fiber, int> getter) =>
16 AddAction(_ => FrameWorker.Instance.Load(fiber:
this, data: Time.frameCount + getter(
this)));
18 private class FrameWorker : Worker<int> {
21 protected override void Recycle() => Cache<FrameWorker>.
Dispose(
this);
23 protected override int CompareTo(Worker other) => Seed.CompareTo((other as FrameWorker)?.Seed);
25 public override bool NoMore => (Seed - 3) >= Time.frameCount;
27 public override void Step() =>
Dispose();
29 protected override bool Prepare() =>
true;
void Dispose()
Cleans up Fiber before it goes into the recycling
static Fiber Instance
Precompile an instance of a fiber command
Fiber SkipFrames(int framesToSkip)
Wait a specific count of Update, FixedUpdate or LateUpdate frames