Beispiel #1
0
        internal void Update()
        {
            for (var i = 0; i < _chains.Count; i++)
            {
                AsyncChain chain = _chains[i];
                ChainLayer layer = _chainsLayers[(int)chain.layer];
                if (layer.paused)
                {
                    continue;
                }
                AsyncCommandResult updateResult = chain.UpdateChain();

                if (updateResult == AsyncCommandResult.Exception)
                {
                    CustomDebug.Log($"Cain '{chain.id}' finished terminated with exception");
                }

                if (!chain.isComplete && updateResult == AsyncCommandResult.Ok)
                {
                    continue;
                }
                chain.ReportComplete();
                _chainsLayers[(int)chain.layer].Dec();
                _chains.RemoveAt(i);
                i--;
            }
        }
Beispiel #2
0
        public static AsyncChain AsLoading(this AsyncChain chain)
        {
            var internalChain = chain as AsyncChainInternal;

            internalChain?.SetAsLoadingLayer();
            return(chain);
        }
Beispiel #3
0
        internal void TerminateChains(AsyncLayer layer)
        {
            int count = _chains.Count;

            for (var i = 0; i < count; i++)
            {
                AsyncChain chain = _chains[i];
                if (layer.HasFlag(chain.layer))
                {
                    chain.Terminate();
                }
            }
        }