Ejemplo n.º 1
0
        private static void _OnLoadSimplePart(WebItem web)
        {
            var bundle = web.assetBundle;

            if (null != web.error || null == bundle)
            {
                return;
            }

            bundle.LoadAllAssets();
        }
Ejemplo n.º 2
0
        public void SetWebManagerParam()
        {
            Application.runInBackground = true;

            if (!Application.isEditor)
            {
                Application.targetFrameRate = 40;
            }
            else
            {
                Application.targetFrameRate = -1;
            }

            Caching.maximumAvailableDiskSpace = 317608096;
            WebItem.SetMaxLoadingCount(6);
        }
Ejemplo n.º 3
0
        private void _OnLoadMainWeb(WebItem web)
        {
            _InitCallback_MainWeb(web);

            if (null != web.error)
            {
                error = string.Format("[InnerWebPrefab._OnLoadMainAsset()] {0}, web.error={1}, web={2}"
                                      , Path.GetFileName(web.argument.localPath), web.error, web);
                _OnLoadAll(web);
                return;
            }

            var bundle = web.assetBundle;

            if (null == bundle)
            {
                error = string.Format("[InnerWebPrefab._OnLoadMainAsset()] bundle is null, web={0}", web);
                _OnLoadAll(web);
                return;
            }

            var manif = WebManager.Instance.Manifest;

            string[] dependences = manif.GetAllDependencies(web.argument.localPath);
            if (null == dependences)
            {
                error = string.Format("[InnerWebPrefab._OnLoadMainAsset()] dependences is null, web={0}", web);
                _OnLoadAll(web);
                return;
            }

            var nodes = new IWebNode[dependences.Length];

            for (int i = 0; i < dependences.Length; ++i)
            {
                var arg = new WebArgument {
                    localPath = dependences [i], flags = WebFlags.UnloadAllLoadedObjects
                };
                var sharedPart = WebManager.Instance.LoadWebItem(arg, _OnLoadSimplePart);
                nodes[i] = sharedPart;
            }

            _partGroutp = new WebGroup(nodes, _OnLoadAll);
            web.HoldBabies(ref nodes);
        }
Ejemplo n.º 4
0
        private static void _Loading(WebItem item)
        {
            if (null != item)
            {
                _Enqueue(item);
                if (_currentLoadingCount < _maxLoadingCount)
                {
                    var isSequentialRoutine = false;
                    if (!_hasSequentialRoutine)
                    {
                        isSequentialRoutine   = true;
                        _hasSequentialRoutine = true;
                    }

                    CoroutineManager.StartCoroutine(_CoLoadDiskItems(isSequentialRoutine));
                }
            }
        }
Ejemplo n.º 5
0
        private static void _Enqueue(WebItem item)
        {
            var flags = item.argument.flags;

            if ((flags & WebFlags.SequentialLoading) != 0)
            {
                _sequentialQueue.Enqueue(item);
            }
            else if ((flags & WebFlags.HighPriority) != 0)
            {
                _highQueue.Enqueue(item);
            }
            else if ((flags & WebFlags.LowPriority) != 0)
            {
                _lowQueue.Enqueue(item);
            }
            else
            {
                _normalQueue.Enqueue(item);
            }
        }
Ejemplo n.º 6
0
 private void _InitCallback_MainWeb(WebItem mainWeb)
 {
     _mainWeb = mainWeb;
     size     = mainWeb.size;
 }
Ejemplo n.º 7
0
        public WebItem LoadWebItem(WebArgument argument, Action <WebItem> handler)
        {
            var web = new WebItem(argument, handler);

            return(web);
        }