internal Enumerator(CoroutineState coroutineState, FrameTiming timing)
            {
                Debug.Assert(timing.IsSpecified());
                var screen = coroutineState.Screen;

                _frameObject = coroutineState.FrameObject;
                _startTime   = screen.Time + screen.FrameDelta;
                _startFrame  = screen.FrameNum + 1;
                _timingPoint = screen.TimingPoints.TimingOf(timing);
            }
Esempio n. 2
0
 internal FrameTimingPointList(IHostScreen screen)
 {
     _screen = screen;
     _frameInitializingPoint = new FrameTimingPoint(screen, FrameTiming.FrameInitializing);
     _earlyUpdatePoint       = new FrameTimingPoint(screen, FrameTiming.EarlyUpdate);
     _updatePoint            = new FrameTimingPoint(screen, FrameTiming.Update);
     _lateUpdatePoint        = new FrameTimingPoint(screen, FrameTiming.LateUpdate);
     _beforeRenderingPoint   = new FrameTimingPoint(screen, FrameTiming.BeforeRendering);
     _afterRenderingPoint    = new FrameTimingPoint(screen, FrameTiming.AfterRendering);
     _internalEndOfFrame     = new FrameTimingPoint(screen, FrameTiming.Internal_EndOfFrame);
 }
Esempio n. 3
0
        public bool TryGetTimingOf(FrameTiming timing, [MaybeNullWhen(false)] out FrameTimingPoint timingPoint)
        {
            // [NOTE]
            // Only for public timing point

            if (timing == FrameTiming.FrameInitializing)
            {
                timingPoint = _frameInitializingPoint;
                return(true);
            }
            else if (timing == FrameTiming.EarlyUpdate)
            {
                timingPoint = _earlyUpdatePoint;
                return(true);
            }
            else if (timing == FrameTiming.Update)
            {
                timingPoint = _updatePoint;
                return(true);
            }
            else if (timing == FrameTiming.LateUpdate)
            {
                timingPoint = _lateUpdatePoint;
                return(true);
            }
            else if (timing == FrameTiming.BeforeRendering)
            {
                timingPoint = _beforeRenderingPoint;
                return(true);
            }
            else if (timing == FrameTiming.AfterRendering)
            {
                timingPoint = _afterRenderingPoint;
                return(true);
            }
            else
            {
                timingPoint = null;
                return(false);
            }
        }
Esempio n. 4
0
 internal FrameAsyncEnumerable(FrameTimingPoint timingPoint, CancellationToken cancellationToken)
 {
     Debug.Assert(timingPoint is not null);
     _timingPoint       = timingPoint;
     _cancellationToken = cancellationToken;
 }