public Continuation(T inst) { instruction = inst; continuation = null; owner = null; Scheduler = FrameScheduler.BeforeUpdate; }
public Continuation(T inst) { instruction = inst; continuation = null; owner = AsyncManager.Instance; Scheduler = FrameScheduler.Update; }
public Continuation(T inst, FrameScheduler scheduler) { instruction = inst; continuation = null; owner = null; Scheduler = scheduler; }
public Continuation(T inst, FrameScheduler scheduler) { instruction = inst; continuation = null; owner = AsyncManager.Instance; Scheduler = scheduler; }
public Continuation(T inst, IManageableObject owner, FrameScheduler scheduler) { instruction = inst; continuation = null; this.owner = owner; Scheduler = scheduler; }
public Continuation(T inst, CancellationToken cancellationToken, FrameScheduler scheduler) { instruction = inst; continuation = null; owner = null; this.cancellationToken = cancellationToken; Scheduler = scheduler; }
public void AddFrame(uint frame, bool loop, System.Action callback) { ++_curAllotID; var frameScheduler = new FrameScheduler { ID = _curAllotID, Frame = frame, RealFrame = frame + _curFrame, IsLoop = loop, Callback = callback }; _frameDelegates.Add(frameScheduler); }
private void UpdateFrameScheduler() { for (var i = 0; i < _frameDelegates.Count;) { FrameScheduler obj = _frameDelegates[i]; if (obj.RealFrame <= _curFrame) { obj.Callback(); if (obj.IsLoop) { obj.RealFrame += obj.Frame; } else { _frameDelegates.RemoveAt(i); continue; } } ++i; } }
/// <summary> /// Link the <see cref="Duality.Async.IAwaitInstruction"/>'s lifespan to an object and /// configure the type of update cycle it should be evaluated on. /// </summary> /// <returns>A continuation with updated params.</returns> public static Continuation <T> ConfigureAwait <T>(this T @this, IManageableObject owner, FrameScheduler scheduler) where T : IAwaitInstruction => new Continuation <T>(@this).ConfigureAwait(owner, scheduler);
/// <summary> /// Link the <see cref="UnityAsync.IAwaitInstruction"/>'s lifespan to a /// <see cref="System.Threading.CancellationToken"/> and configure the type of update cycle it should be /// evaluated on. /// </summary> /// <returns>A continuation with updated params.</returns> public static AwaitInstructionAwaiter <T> ConfigureAwait <T>(this T i, CancellationToken cancellationToken, FrameScheduler scheduler) where T : IAwaitInstruction => new AwaitInstructionAwaiter <T>(i, cancellationToken, scheduler);
/// <summary> /// Configure the type of update cycle it should be evaluated on. /// </summary> /// <returns>A continuation with updated params.</returns> public static AwaitInstructionAwaiter <T> ConfigureAwait <T>(this T i, FrameScheduler scheduler) where T : IAwaitInstruction => new AwaitInstructionAwaiter <T>(i, scheduler);
public Continuation <T> ConfigureAwait(IManageableObject owner, FrameScheduler scheduler) { this.owner = owner; Scheduler = scheduler; return(this); }
public Continuation <T> ConfigureAwait(CancellationToken cancellationToken, FrameScheduler scheduler) { this.cancellationToken = cancellationToken; Scheduler = scheduler; return(this); }
public Continuation <T> ConfigureAwait(FrameScheduler scheduler) { Scheduler = scheduler; return(this); }
/// <summary> /// Configure the type of update cycle it should be evaluated on. /// </summary> /// <returns>A continuation with updated params.</returns> public static Continuation <T> ConfigureAwait <T>(this T @this, FrameScheduler scheduler) where T : IAwaitInstruction => new Continuation <T>(@this).ConfigureAwait(scheduler);
/// <summary> /// Link the <see cref="Duality.Async.IAwaitInstruction"/>'s lifespan to a /// <see cref="System.Threading.CancellationToken"/> and configure the type of update cycle it should be /// evaluated on. /// </summary> /// <returns>A continuation with updated params.</returns> public static Continuation <T> ConfigureAwait <T>(this T @this, CancellationToken cancellationToken, FrameScheduler scheduler) where T : IAwaitInstruction => new Continuation <T>(@this).ConfigureAwait(cancellationToken, scheduler);
/// <summary> /// Link the <see cref="UnityAsync.IAwaitInstruction"/>'s lifespan to a <see cref="UnityEngine.Object"/> and /// configure the type of update cycle it should be evaluated on. /// </summary> /// <returns>A continuation with updated params.</returns> public static AwaitInstructionAwaiter <T> ConfigureAwait <T>(this T i, MonoBehaviour parent, FrameScheduler scheduler) where T : IAwaitInstruction => new AwaitInstructionAwaiter <T>(i, parent, scheduler);