Example #1
0
        internal static UniTask <AsyncUnit> CreateTask(LayerTimingPoint timingPoint, CancellationToken cancellationToken)
        {
            var token = _tokenFactory.CreateToken();

            if (ChainInstancePool <LayerTimingAwaitableTaskSource> .TryGetInstanceFast(out var taskSource))
            {
                taskSource._awaitableCore = new(timingPoint, token, cancellationToken);
            }
            else
            {
                taskSource = new LayerTimingAwaitableTaskSource(timingPoint, token, cancellationToken);
            }
            return(new UniTask <AsyncUnit>(taskSource, token));
        }
Example #2
0
 internal LayerTimingPointList(Layer layer)
 {
     _layer = layer;
     _beforeRenderingPoint = new LayerTimingPoint(layer);
     _afterRenderingPoint  = new LayerTimingPoint(layer);
 }