コード例 #1
0
        public void OnUpdate(float dt)
        {
            if (_loader != null)
            {
                _loader.OnUpdate();
            }
            int length = _otherOperation.Count - 1;

            for (int i = length; i >= 0; i--)
            {
                LoadOpertion loadOpertion = _otherOperation[i];
                loadOpertion.OnUpdate();
                if (loadOpertion.IsDone())
                {
                    _otherOperation.RemoveAt(i);
                }
            }

            length = _loadOpertions.Count - 1;
            for (int i = length; i >= 0; i--)
            {
                ResLoadOpertion loadOpertion = _loadOpertions[i];
                loadOpertion.OnUpdate();
                if (!loadOpertion.IsExit())
                {
                    continue;
                }

                _onLoadingRes.RemoveAt(i);
                _loadOpertions.RemoveAt(i);
            }
        }
コード例 #2
0
        public void OnUpdate()
        {
            // 1.更新请求
            int length = _onLoadingRequest.Count - 1;

            for (int i = length; i >= 0; i--)
            {
                ResLoadOpertion opertion = _onLoadingRequest[i];
                opertion.OnUpdate();
                if (opertion.IsExit())
                {
                    opertion.UnloadRequest();
                    _onLoadingRequest.RemoveAt(i);
                    _onLoadingAbPackage.RemoveAt(i);
                }
            }

            // 检测新的内容
            int removeCount = 0;

            length = _waitToLoadRequest.Count;
            for (int i = 0; i < length; i++)
            {
                if (_onLoadingRequest.Count >= _maxLoadingCount)
                {
                    break;
                }
                ResLoadOpertion loadOpertion = _waitToLoadRequest[i];
                removeCount++;
                _onLoadingRequest.Add(loadOpertion);
                _onLoadingAbPackage.Add(loadOpertion.RequestResPath);
            }
            if (removeCount > 0)
            {
                _waitToLoadRequest.RemoveRange(0, removeCount);
                _onWaitAbPackage.RemoveRange(0, removeCount);
            }
        }