예제 #1
0
 public Continuation(T inst)
 {
     instruction  = inst;
     continuation = null;
     owner        = null;
     Scheduler    = FrameScheduler.BeforeUpdate;
 }
예제 #2
0
 public Continuation(T inst)
 {
     instruction  = inst;
     continuation = null;
     owner        = AsyncManager.Instance;
     Scheduler    = FrameScheduler.Update;
 }
예제 #3
0
 public Continuation(T inst, FrameScheduler scheduler)
 {
     instruction  = inst;
     continuation = null;
     owner        = null;
     Scheduler    = scheduler;
 }
예제 #4
0
 public Continuation(T inst, FrameScheduler scheduler)
 {
     instruction  = inst;
     continuation = null;
     owner        = AsyncManager.Instance;
     Scheduler    = scheduler;
 }
예제 #5
0
 public Continuation(T inst, IManageableObject owner, FrameScheduler scheduler)
 {
     instruction  = inst;
     continuation = null;
     this.owner   = owner;
     Scheduler    = scheduler;
 }
예제 #6
0
 public Continuation(T inst, CancellationToken cancellationToken, FrameScheduler scheduler)
 {
     instruction            = inst;
     continuation           = null;
     owner                  = null;
     this.cancellationToken = cancellationToken;
     Scheduler              = scheduler;
 }
예제 #7
0
    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);
    }
예제 #8
0
 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;
     }
 }
예제 #9
0
 /// <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);
예제 #10
0
 /// <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);
예제 #11
0
 /// <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);
예제 #12
0
 public Continuation <T> ConfigureAwait(IManageableObject owner, FrameScheduler scheduler)
 {
     this.owner = owner;
     Scheduler  = scheduler;
     return(this);
 }
예제 #13
0
 public Continuation <T> ConfigureAwait(CancellationToken cancellationToken, FrameScheduler scheduler)
 {
     this.cancellationToken = cancellationToken;
     Scheduler = scheduler;
     return(this);
 }
예제 #14
0
 public Continuation <T> ConfigureAwait(FrameScheduler scheduler)
 {
     Scheduler = scheduler;
     return(this);
 }
예제 #15
0
 /// <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);
예제 #16
0
 /// <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);
예제 #17
0
파일: Extensions.cs 프로젝트: Hoodrij/Core
 /// <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);