예제 #1
0
 public void Open(ResourceManagerArgs args)
 {
     _bytesPerSecond     = args.bytesPerSecond;
     _bytesPerSecondIdle = args.bytesPerSecondIdle;
     _worker             = new DownloadWorker(onDownloadJobDone, args.bufferSize, args.urls,
                                              System.Threading.ThreadPriority.BelowNormal);
     _idleWorker = new DownloadWorker(onDownloadJobDone, args.bufferSize, args.urls,
                                      System.Threading.ThreadPriority.Lowest);
     _localPathRoot        = args.localPathRoot;
     _assetPathTransformer = args.assetPathTransformer;
     _password             = args.password;
     _streamingAssets      = new StreamingAssetsLoader();
     _streamingAssets.LoadEmbeddedManifest(streamingAssets =>
     {
         if (args.useBaseManifest)
         {
             Helpers.ReadSAManifest(_password, (manifest, fileEntry) =>
             {
                 SetManifest(manifest, fileEntry);
             });
         }
         else
         {
             Helpers.GetManifest(_localPathRoot, _worker, args.manifestChecksum, args.manifestSize, args.manifestRSize,
                                 _password, args.manifestChunkSize, (manifest, fileEntry) =>
             {
                 SetManifest(manifest, fileEntry);
             });
         }
     });
 }
예제 #2
0
 public void Open(ResourceManagerArgs args)
 {
     try
     {
         ResourceManager.GetListener().OnSetManifest();
     }
     catch (Exception exception)
     {
         Debug.LogWarningFormat("OnSetManifest exception\n{0}", exception);
     }
 }
예제 #3
0
 public BundleAssetProvider(ResourceManagerArgs args)
 {
     _bytesPerSecond     = args.bytesPerSecond;
     _bytesPerSecondIdle = args.bytesPerSecondIdle;
     _worker             = new DownloadWorker(onDownloadJobDone, args.bufferSize, args.urls,
                                              System.Threading.ThreadPriority.BelowNormal);
     _idleWorker = new DownloadWorker(onDownloadJobDone, args.bufferSize, args.urls,
                                      System.Threading.ThreadPriority.Lowest);
     _localPathRoot        = args.localPathRoot;
     _assetPathTransformer = args.assetPathTransformer;
 }
예제 #4
0
 public void Open(ResourceManagerArgs args)
 {
     _password = args.password;
     Helpers.GetManifest(_localPathRoot, _worker, args.manifestChecksum, args.manifestSize, args.manifestRSize,
                         _password, (manifest, fileEntry) =>
     {
         _streamingAssets = new StreamingAssetsLoader();
         _streamingAssets.LoadEmbeddedManifest(streamingAssets =>
         {
             SetManifest(manifest, fileEntry);
             ResourceManager.GetListener().OnSetManifest();
         });
     });
 }
예제 #5
0
        public static void Initialize(ResourceManagerArgs args)
        {
            _urls.Clear();
            _urls.AddRange(args.urls);
            if (_listener == null)
            {
                _listener = new EmptyAssetProviderListener();
            }

            JobScheduler.Initialize();

            if (_assetProvider != null)
            {
                _assetProvider.Close();
            }

#if UNITY_EDITOR
            if (_analyzer == null)
            {
                if (!string.IsNullOrEmpty(args.listDataPath))
                {
                    var listData =
                        UnityEditor.AssetDatabase.LoadMainAssetAtPath(NormalizedListPath(args.listDataPath)) as
                        AssetListData;
                    if (listData != null)
                    {
                        _analyzer = new Analyzer.DefaultAssetsAnalyzer(listData);
                    }
                }
            }

            if (args.devMode)
            {
                _assetProvider = new AssetDatabaseAssetProvider(args.asyncSimMin, args.asyncSimMax);
            }
            else
#endif
            {
                _assetProvider = new BundleAssetProvider();
            }

            args.oninitialize?.Invoke();
            _assetProvider.Open(args);
            if (args.oncomplete != null)
            {
                _assetProvider.completed += args.oncomplete;
            }
        }
예제 #6
0
 public void Open(ResourceManagerArgs args)
 {
     _password = args.password;
     Helpers.GetManifest(_localPathRoot, _worker, args.manifestChecksum, args.manifestSize, args.manifestRSize,
                         _password, (manifest, fileEntry) =>
     {
         _streamingAssets = new StreamingAssetsLoader();
         _streamingAssets.LoadEmbeddedManifest(streamingAssets =>
         {
             SetManifest(manifest, fileEntry);
             try
             {
                 ResourceManager.GetListener().OnSetManifest();
             }
             catch (Exception exception)
             {
                 Debug.LogWarningFormat("OnSetManifest exception\n{0}", exception);
             }
         });
     });
 }
예제 #7
0
        public static void Initialize(ResourceManagerArgs args)
        {
            _listener = new EmptyAssetProviderListener();
            UnityFS.JobScheduler.Initialize();
#if UNITY_EDITOR
            if (args.devMode)
            {
                _assetProvider = new UnityFS.AssetDatabaseAssetProvider();
            }
            else
#endif
            {
                _assetProvider = new UnityFS.BundleAssetProvider(args.localPathRoot, args.urls, args.concurrentTasks, args.slow, args.bufferSize, args.assetPathTransformer);
            }
            if (args.oninitialize != null)
            {
                args.oninitialize();
            }
            _assetProvider.Open();
            if (args.oncomplete != null)
            {
                _assetProvider.completed += args.oncomplete;
            }
        }
예제 #8
0
 public void Open(ResourceManagerArgs args)
 {
     ResourceManager.GetListener().OnSetManifest();
 }